diff --git a/lib/hawat/blueprints/auth/test/__init__.py b/lib/hawat/blueprints/auth/test/__init__.py index d1ca73f643293660969671e72f10bf562134ee4a..639b58e31e86c68b9a850634e3ecd727469c563f 100644 --- a/lib/hawat/blueprints/auth/test/__init__.py +++ b/lib/hawat/blueprints/auth/test/__init__.py @@ -21,10 +21,7 @@ import unittest from hawat.test import HawatTestCase from hawat.test.runner import TestRunnerMixin -_IS_NOSE = sys.argv[0].endswith('nosetests') - -@unittest.skipIf(_IS_NOSE, "broken under nosetest") class AuthTestCase(TestRunnerMixin, HawatTestCase): """ Class for testing :py:mod:`hawat.blueprints.auth` blueprint. diff --git a/lib/hawat/blueprints/auth_api/test/__init__.py b/lib/hawat/blueprints/auth_api/test/__init__.py index 2dd9bebfb4a00eb04c902c0e44bb9ec62405bdbf..35961e1096cd599debb2be1920a13c247aa885f7 100644 --- a/lib/hawat/blueprints/auth_api/test/__init__.py +++ b/lib/hawat/blueprints/auth_api/test/__init__.py @@ -24,10 +24,7 @@ import hawat.db from hawat.test import HawatTestCase from hawat.test.runner import TestRunnerMixin -_IS_NOSE = sys.argv[0].endswith('nosetests') - -@unittest.skipIf(_IS_NOSE, "broken under nosetest") class AuthAPITestCase(TestRunnerMixin, HawatTestCase): """ Class for testing :py:mod:`hawat.blueprints.auth_api` blueprint. @@ -122,7 +119,6 @@ class AuthAPITestCase(TestRunnerMixin, HawatTestCase): ) self.assertEqual(response.status_code, 200) self.assertTrue(b'Welcome!' in response.data) - self.assertTrue(b'My account' in response.data) self.assertTrue(b'data-user-name="admin"' in response.data) for tcase in ( @@ -136,7 +132,6 @@ class AuthAPITestCase(TestRunnerMixin, HawatTestCase): ) self.assertEqual(response.status_code, 200) self.assertTrue(b'Welcome!' in response.data) - self.assertTrue(b'My account' in response.data) self.assertTrue(b'data-user-name="admin"' in response.data) @hawat.test.do_as_user_decorator(hawat.const.ROLE_USER) diff --git a/lib/hawat/blueprints/auth_env/test/__init__.py b/lib/hawat/blueprints/auth_env/test/__init__.py index ffbea6920d454d596ecd1e55b21b258411fa80a4..34888e5b503c4c0c7f5f367171e73459e2abcf7a 100644 --- a/lib/hawat/blueprints/auth_env/test/__init__.py +++ b/lib/hawat/blueprints/auth_env/test/__init__.py @@ -27,7 +27,6 @@ class AuthEnvTestCase(TestRunnerMixin, RegistrationHawatTestCase): Class for testing :py:mod:`hawat.blueprints.auth_env` blueprint. """ - @unittest.skip("temporarily disabled") def test_01_login_user(self): """ Test login/logout with *auth_env* module - user 'user'. @@ -48,7 +47,6 @@ class AuthEnvTestCase(TestRunnerMixin, RegistrationHawatTestCase): self.assertEqual(response.status_code, 200) self.assertTrue(b'You have been successfully logged out' in response.data) - @unittest.skip("temporarily disabled") def test_02_login_developer(self): """ Test login/logout with *auth_env* module - user 'developer'. @@ -69,7 +67,6 @@ class AuthEnvTestCase(TestRunnerMixin, RegistrationHawatTestCase): self.assertEqual(response.status_code, 200) self.assertTrue(b'You have been successfully logged out' in response.data) - @unittest.skip("temporarily disabled") def test_03_login_admin(self): """ Test login/logout with *auth_env* module - user 'admin'. @@ -90,7 +87,6 @@ class AuthEnvTestCase(TestRunnerMixin, RegistrationHawatTestCase): self.assertEqual(response.status_code, 200) self.assertTrue(b'You have been successfully logged out' in response.data) - @unittest.skip("temporarily disabled") def test_04_register(self): """ Test registration with *auth_env* module - new user 'test'. @@ -170,7 +166,6 @@ class AuthEnvTestCase(TestRunnerMixin, RegistrationHawatTestCase): } ) - @unittest.skip("temporarily disabled") def test_05_register_fail(self): """ Test registration with *auth_env* module - existing user 'user'. diff --git a/lib/hawat/blueprints/changelogs/test/__init__.py b/lib/hawat/blueprints/changelogs/test/__init__.py index 5fcb2e3dd6a76b439d8f2f71c691208c2bf53bfb..6a58ca51b9f61398926d808cbdd5c4d5ee2b857b 100644 --- a/lib/hawat/blueprints/changelogs/test/__init__.py +++ b/lib/hawat/blueprints/changelogs/test/__init__.py @@ -25,10 +25,6 @@ from hawat.test import HawatTestCase from hawat.test.runner import TestRunnerMixin -_IS_NOSE = sys.argv[0].endswith('nosetests') - - -@unittest.skipIf(_IS_NOSE, "broken under nosetests") class ChangeLogsSearchTestCase(TestRunnerMixin, HawatTestCase): """Class for testing ``changelogs.search`` endpoint.""" diff --git a/lib/hawat/blueprints/devtools/test/__init__.py b/lib/hawat/blueprints/devtools/test/__init__.py index c35d8f328de3d8bdcf28f2b16afa89394d9ef423..a5629505584cddd592e083dc7a4f18f1ee620756 100644 --- a/lib/hawat/blueprints/devtools/test/__init__.py +++ b/lib/hawat/blueprints/devtools/test/__init__.py @@ -20,9 +20,6 @@ from hawat.test import HawatTestCase from hawat.test.runner import TestRunnerMixin -_IS_NOSE = sys.argv[0].endswith('nosetests') - -@unittest.skipIf(_IS_NOSE, "broken under nosetest") class ConfigTestCase(TestRunnerMixin, HawatTestCase): """ Class for testing ``devtools.config`` endpoint. @@ -30,6 +27,17 @@ class ConfigTestCase(TestRunnerMixin, HawatTestCase): This endpoint is for developers only. """ + def _attempt_fail_redirect(self): + self.assertGetURL( + '/devtools/config', + 302, + [ + b'Redirecting...', + b'login?next=' + ], + follow_redirects=False + ) + def _attempt_fail(self): self.assertGetURL( '/devtools/config', @@ -51,7 +59,7 @@ class ConfigTestCase(TestRunnerMixin, HawatTestCase): def test_01_as_anonymous(self): """Test access as anonymous user.""" - self._attempt_fail() + self._attempt_fail_redirect() @hawat.test.do_as_user_decorator(hawat.const.ROLE_USER) def test_02_as_user(self): diff --git a/lib/hawat/blueprints/hosts/__init__.py b/lib/hawat/blueprints/hosts/__init__.py index 4be2da083fdd1ded59f5392c8bf90138bcf6c0be..a25b9346f7338be9ace02c3b699f0454882612a4 100644 --- a/lib/hawat/blueprints/hosts/__init__.py +++ b/lib/hawat/blueprints/hosts/__init__.py @@ -49,7 +49,7 @@ class AbstractSearchView(PsycopgMixin, BaseSearchView): # pylint: disable=local """ authentication = True - authorization = [hawat.acl.PERMISSION_DEVELOPER] + authorization = [hawat.acl.PERMISSION_POWER] @classmethod def get_menu_title(cls, **kwargs):