From 7d7b4df103fa119b543c96785be548e4bb4b55ee Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 11 Jul 2021 23:49:38 +0200 Subject: [PATCH] tweaks for install on Mac + fix test users models --- .pylintrc | 2 +- requirements-3.7.txt | 2 -- tests/test_users.py | 5 +++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.pylintrc b/.pylintrc index a69fc72b..fb880781 100644 --- a/.pylintrc +++ b/.pylintrc @@ -3,4 +3,4 @@ disable=bad-continuation [TYPECHECK] -ignored-classes=Permission +ignored-classes=Permission,SQLObject,Registrant,scoped_session diff --git a/requirements-3.7.txt b/requirements-3.7.txt index f7cba7e5..0ebe5e7c 100644 --- a/requirements-3.7.txt +++ b/requirements-3.7.txt @@ -2,7 +2,6 @@ alembic==1.6.5 Babel==2.9.1 blinker==1.4 click==8.0.1 -cracklib==2.9.3 dnspython==2.1.0 dominate==2.6.0 email-validator==1.1.3 @@ -24,7 +23,6 @@ Jinja2==3.0.1 Mako==1.1.4 MarkupSafe==2.0.1 Pillow==8.3.1 -pkg-resources==0.0.0 psycopg2==2.9.1 PyJWT==2.1.0 python-dateutil==2.8.1 diff --git a/tests/test_users.py b/tests/test_users.py index 95e89994..34a8d570 100644 --- a/tests/test_users.py +++ b/tests/test_users.py @@ -5,7 +5,6 @@ Usage: python -m unittest tests.test_users """ -import os import unittest from flask import current_app @@ -19,6 +18,8 @@ DEPT = "XX" class UserModelCase(unittest.TestCase): + """Test user, roles and permissions""" + def setUp(self): app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite://" app.app_context().push() @@ -112,7 +113,7 @@ class UserModelCase(unittest.TestCase): self.assertTrue(u.has_permission(perm, dept)) # Le grand admin a accès à tous les départements: self.assertTrue(u.has_permission(perm, dept + "XX")) - self.assertTrue("Admin" == u.roles[0].name) + self.assertTrue(u.roles[0].name == "SuperAdmin") def test_create_delete(self): u = User(user_name="dupont", nom="Dupont", prenom="Pierre")