Files
mayan-edms/mayan/apps/common/tests/test_api.py
Roberto Rosario 60ac63ead4 Add new sidebar main menu
Add a left side menu navigation style. The main app navigation links
will be displayed here. The notification, user and system tools are now
displayed at the top navigation bar.

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
2018-12-20 16:47:02 -04:00

34 lines
1.1 KiB
Python

from __future__ import unicode_literals
from django.test import override_settings
from django.urls import reverse
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='menu_main')
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='menu_main')
response = self.client.get(template_main_menu.get_absolute_url())
self.assertNotContains(
response=response, text=TEST_TEMPLATE_RESULT, status_code=403
)