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>
33 lines
1010 B
Python
33 lines
1010 B
Python
from __future__ import absolute_import, unicode_literals
|
|
|
|
from mayan.apps.common.tests import GenericViewTestCase
|
|
|
|
from ..permissions import permission_settings_view
|
|
|
|
|
|
class SmartSettingViewPermissionsTestCase(GenericViewTestCase):
|
|
def setUp(self):
|
|
super(SmartSettingViewPermissionsTestCase, self).setUp()
|
|
self.login_user()
|
|
|
|
def test_view_access_denied(self):
|
|
response = self.get('settings:namespace_list')
|
|
|
|
self.assertEqual(response.status_code, 403)
|
|
|
|
response = self.get(
|
|
'settings:namespace_detail', args=('common',)
|
|
)
|
|
self.assertEqual(response.status_code, 403)
|
|
|
|
def test_view_access_permitted(self):
|
|
self.grant_permission(permission=permission_settings_view)
|
|
|
|
response = self.get('settings:namespace_list')
|
|
self.assertEqual(response.status_code, 200)
|
|
|
|
response = self.get(
|
|
'settings:namespace_detail', args=('common',)
|
|
)
|
|
self.assertEqual(response.status_code, 200)
|