From 5c6b9e60547a5884b7debe450aa0ddaea075d4f9 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Sun, 31 May 2020 11:40:43 +0100 Subject: working on user groups and tests --- ctrack/users/tests/test_credentials.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'ctrack/users') 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() -- cgit v1.2.3