aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/users/tests/test_credentials.py
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-05-31 12:39:39 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-05-31 12:39:39 +0100
commit65a2075bdbcf731507c25e0eb8737a1bbf3ac2bd (patch)
tree0a77c3ff9d375bcad9b3ff8e6689e773cfb067f0 /ctrack/users/tests/test_credentials.py
parentaf2b9c55ef2b9e821119124be727f4beb0e2b7b9 (diff)
another testing passing related to groups
Diffstat (limited to '')
-rw-r--r--ctrack/users/tests/test_credentials.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/ctrack/users/tests/test_credentials.py b/ctrack/users/tests/test_credentials.py
index a63ffe0..496eeaf 100644
--- a/ctrack/users/tests/test_credentials.py
+++ b/ctrack/users/tests/test_credentials.py
@@ -1,6 +1,6 @@
"""
-THIS TEST IS FROM REALPYTHON ARTICLE
-https://realpython.com/django-pytest-fixtures/
+THE INITIATIVE FOR THIS TEST IS FROM REALPYTHON ARTICLE
+https://realpython.com/Django-pytest-fixtures/
The permissions here are not optimal for this project yet.
TODO - make them so!
@@ -22,10 +22,12 @@ def user_A(db) -> Group:
return user
-def test_there_is_a_cct_user_group(db):
+def test_there_is_a_cct_user_group(db): # adding fixture here
group = Group.objects.create(name="cct_user")
assert Group.objects.get(name="cct_user")
- user = get_user_model().objects.create_user("INSPECTOR")
+ user = get_user_model().objects.create_user(
+ username="INSPECTOR", name="Mrs Inspector"
+ )
user.groups.add(group)
assert group in user.groups.all()