diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-05-31 11:40:43 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-05-31 11:40:43 +0100 |
commit | 5c6b9e60547a5884b7debe450aa0ddaea075d4f9 (patch) | |
tree | 3aa263142f691d311f754da53b8a31dfaad23928 /ctrack/users/tests | |
parent | 9917bd1793d0362b84704d0ad4409be4ec9dbdd3 (diff) |
working on user groups and tests
Diffstat (limited to 'ctrack/users/tests')
-rw-r--r-- | ctrack/users/tests/test_credentials.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ctrack/users/tests/test_credentials.py b/ctrack/users/tests/test_credentials.py index 7538643..a63ffe0 100644 --- a/ctrack/users/tests/test_credentials.py +++ b/ctrack/users/tests/test_credentials.py @@ -22,9 +22,17 @@ def user_A(db) -> Group: return user -def test_should_create_user(user_A: get_user_model()) -> None: - assert user_A.username == "A" +def test_there_is_a_cct_user_group(db): + group = Group.objects.create(name="cct_user") + assert Group.objects.get(name="cct_user") + user = get_user_model().objects.create_user("INSPECTOR") + user.groups.add(group) + assert group in user.groups.all() + + +# def test_should_create_user(user_A: get_user_model()) -> None: +# assert user_A.username == "A" -def test_user_is_in_app_user_group(user_A: get_user_model()) -> None: - assert user_A.groups.filter(name="cct_user").exists() +# def test_user_is_in_app_user_group(user_A: get_user_model()) -> None: +# assert user_A.groups.filter(name="cct_user").exists() |