Skip to content
Snippets Groups Projects
Commit e5ab0a9e authored by Rajmund Hruška's avatar Rajmund Hruška
Browse files

Merge branch 'hruska-bugfix-#7587-deprecation-warnings' into devel

parents 9930c23a 8cc89d76
No related branches found
No related tags found
No related merge requests found
Showing
with 48 additions and 57 deletions
......@@ -48,6 +48,9 @@ pip-delete-this-directory.txt
# Ignore compiled translations catalogs.
messages.mo
# Ignore test results.
nose2-junit.xml
# Ignore precompiled files for PLY.
parser.out
parsetab.py
......
......@@ -606,7 +606,7 @@ pylint: FORCE
test: FORCE
@echo "\n$(GREEN)*** Checking code with nosetests ***$(NC)\n"
@echo "Python version: `$(PYTHON) --version`"
APP_ROOT_PATH=$(shell realpath ./chroot) PYTHONPATH=$(DIR_LIB) $(NOSETESTS)
APP_ROOT_PATH=$(shell realpath ./chroot) PYTHONPATH=$(DIR_LIB) $(PYTHON) -W always::DeprecationWarning -m nose2
coverage: FORCE
@echo "\n$(GREEN)*** Checking test code coverage with nosetests and coverage ***$(NC)\n"
......
setuptools==46.1.3
wheel==0.34.2
nose==1.3.7
nose2==0.11.0
coverage==5.0.4
pyflakes==2.1.1
pylint==2.4.4
......
setuptools
wheel
nose
nose2
coverage
pyflakes
pylint
......
......@@ -4,36 +4,37 @@ ply==3.11
psycopg2==2.8.4
babel==2.8.0
wtforms==2.2.1
wtforms_sqlalchemy>=0.3,<1.0
sqlalchemy==1.3.15
alembic==1.4.2
jinja2==3.0.3
blinker==1.4
bsddb3==6.2.7
werkzeug==2.0.2
flask==1.1.1
flask-login==0.5.0
flask-mail==0.9.1
flask-migrate==2.5.3
flask-babel==1.0.0
flask-principal==0.4.0
flask-wtf==0.14.3
flask-script==2.0.6
flask-sqlalchemy==2.4.1
flask-debugtoolbar==0.11.0
flask-jsglue==0.3.1
werkzeug>=2.2.0,<3.0.0
flask>=2.1.3,<3.0.0
flask-login>=0.6.1,<1.0.0
flask-mail>=0.9.1,<1.0.0
flask-migrate>=3.1.0,<4.0.0
flask-babel>=2.0.0,<3.0.0
flask-principal>=0.4.0,<1.0.0
flask-wtf>=1.0.1,<2.0.0
flask-script>=2.0.6,<3.0.0
flask-sqlalchemy>=2.5.1,<3.0.0
flask-debugtoolbar>=0.13.1,<1.0.0
flask-jsglue>=0.3.1,<1.0.0
dnspython==1.16.0
geoip2==3.0.0
maxminddb==1.5.2
requests==2.23.0
rrdtool==0.1.15
pyyaml==5.3.1
pydgets==0.9
pyzenkit==0.64
pynspect==0.20
ipranges==0.1.10
typedcols==0.1.13
idea-format==0.1.11
pydgets>=0.9,<1.0
pyzenkit>=0.61,<1.0
pynspect>=0.20,<1.0
ipranges>=0.1.10,<1.0.0
typedcols>=0.1.13,<1.0.0
idea-format>=0.1.11,<1.0.0
python-dateutil==2.8.1
PyBabel-json-md==0.1.0
itsdangerous==2.0.1
itsdangerous>=2.1.2,<3.0.0
......@@ -15,16 +15,12 @@ Unit tests for :py:mod:`hawat.blueprints.auth`.
__author__ = "Jan Mach <jan.mach@cesnet.cz>"
__credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea.kropacova@cesnet.cz>"
import sys
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.
......
......@@ -15,7 +15,6 @@ Unit tests for :py:mod:`hawat.blueprints.auth_api`.
__author__ = "Jan Mach <jan.mach@cesnet.cz>"
__credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea.kropacova@cesnet.cz>"
import sys
import unittest
import hawat.const
......@@ -24,10 +23,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 +118,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 +131,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)
......
......@@ -16,7 +16,7 @@ __author__ = "Jan Mach <jan.mach@cesnet.cz>"
__credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea.kropacova@cesnet.cz>"
import wtforms
from wtforms.ext.sqlalchemy.fields import QuerySelectMultipleField
from wtforms_sqlalchemy.fields import QuerySelectMultipleField
import flask
import flask_wtf
from flask_babel import lazy_gettext
......
......@@ -16,7 +16,7 @@ __author__ = "Jan Mach <jan.mach@cesnet.cz>"
__credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea.kropacova@cesnet.cz>"
import wtforms
from wtforms.ext.sqlalchemy.fields import QuerySelectMultipleField
from wtforms_sqlalchemy.fields import QuerySelectMultipleField
from flask_babel import lazy_gettext
......
......@@ -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'.
......
......@@ -17,7 +17,7 @@ __credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea
import wtforms
import flask_wtf
from wtforms.ext.sqlalchemy.fields import QuerySelectMultipleField
from wtforms_sqlalchemy.fields import QuerySelectMultipleField
from flask_babel import lazy_gettext
from hawat.forms import check_login, check_unique_login, get_available_groups, check_null_character
......
......@@ -16,7 +16,7 @@ __author__ = "Jan Mach <jan.mach@cesnet.cz>"
__credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea.kropacova@cesnet.cz>"
import wtforms
from wtforms.ext.sqlalchemy.fields import QuerySelectMultipleField
from wtforms_sqlalchemy.fields import QuerySelectMultipleField
import flask
import flask_wtf
from flask_babel import lazy_gettext
......
......@@ -15,7 +15,6 @@ Unit tests for :py:mod:`hawat.blueprints.changelogs`.
__author__ = "Jan Mach <jan.mach@cesnet.cz>"
__credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea.kropacova@cesnet.cz>"
import sys
import unittest
import hawat.const
......@@ -25,10 +24,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."""
......
......@@ -10,7 +10,6 @@ Unit tests for :py:mod:`hawat.blueprints.devtools`.
"""
import sys
import unittest
import hawat.const
......@@ -20,9 +19,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 +26,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 +58,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):
......
......@@ -17,7 +17,7 @@ __author__ = "Jan Mach <jan.mach@cesnet.cz>"
__credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea.kropacova@cesnet.cz>"
import wtforms
from wtforms.ext.sqlalchemy.fields import QuerySelectMultipleField
from wtforms_sqlalchemy.fields import QuerySelectMultipleField
import flask_wtf
from flask_babel import lazy_gettext
......
......@@ -18,7 +18,7 @@ __credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea
import pynspect.gparser
import wtforms
from wtforms.ext.sqlalchemy.fields import QuerySelectField
from wtforms_sqlalchemy.fields import QuerySelectField
#
# Flask related modules.
......
......@@ -17,7 +17,7 @@ __credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea
import sqlalchemy
import wtforms
from wtforms.ext.sqlalchemy.fields import QuerySelectField, QuerySelectMultipleField
from wtforms_sqlalchemy.fields import QuerySelectField, QuerySelectMultipleField
#
# Flask related modules.
......
......@@ -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):
......
......@@ -16,7 +16,7 @@ __author__ = "Jan Mach <jan.mach@cesnet.cz>"
__credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea.kropacova@cesnet.cz>"
import wtforms
from wtforms.ext.sqlalchemy.fields import QuerySelectField
from wtforms_sqlalchemy.fields import QuerySelectField
#
# Flask related modules.
......
......@@ -16,7 +16,7 @@ __author__ = "Jan Mach <jan.mach@cesnet.cz>"
__credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea.kropacova@cesnet.cz>"
import wtforms
from wtforms.ext.sqlalchemy.fields import QuerySelectMultipleField
from wtforms_sqlalchemy.fields import QuerySelectMultipleField
import flask_login
import flask_wtf
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment