Instead of inserting the path of the apps into the Python app, the apps are now referenced by their full import path. This solves name clashes with external or native Python libraries. Example: Mayan statistics app vs. Python new statistics library. Every app reference is now prepended with 'mayan.apps'. Existing config.yml files need to be updated manually. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
from __future__ import unicode_literals
|
|
|
|
from django.urls import reverse
|
|
from django.test import override_settings
|
|
|
|
from mayan.apps.rest_api.tests import BaseAPITestCase
|
|
|
|
from ..classes import Template
|
|
|
|
TEST_TEMPLATE_RESULT = '<div'
|
|
|
|
|
|
class CommonAPITestCase(BaseAPITestCase):
|
|
def test_content_type_list_view(self):
|
|
response = self.client.get(reverse('rest_api:content-type-list'))
|
|
self.assertEqual(response.status_code, 200)
|
|
|
|
@override_settings(LANGUAGE_CODE='de')
|
|
def test_template_detail_view(self):
|
|
self.login_user()
|
|
template_main_menu = Template.get(name='main_menu')
|
|
response = self.client.get(template_main_menu.get_absolute_url())
|
|
|
|
self.assertContains(
|
|
response=response, text=TEST_TEMPLATE_RESULT, status_code=200
|
|
)
|
|
|
|
def test_template_detail_anonymous_view(self):
|
|
template_main_menu = Template.get(name='main_menu')
|
|
response = self.client.get(template_main_menu.get_absolute_url())
|
|
self.assertNotContains(
|
|
response=response, text=TEST_TEMPLATE_RESULT, status_code=403
|
|
)
|