diff options
Diffstat (limited to 'ctrack/users')
-rw-r--r-- | ctrack/users/admin.py | 6 | ||||
-rw-r--r-- | ctrack/users/tests/test_models.py | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/ctrack/users/admin.py b/ctrack/users/admin.py index 120cc64..7e930d8 100644 --- a/ctrack/users/admin.py +++ b/ctrack/users/admin.py @@ -12,6 +12,8 @@ class UserAdmin(auth_admin.UserAdmin): form = UserChangeForm add_form = UserCreationForm - fieldsets = (("User", {"fields": ("name",)}),) + auth_admin.UserAdmin.fieldsets - list_display = ["username", "name", "is_superuser"] + fieldsets = ( + ("User", {"fields": ("name", "stakeholder")}), + ) + auth_admin.UserAdmin.fieldsets + list_display = ["username", "name", "is_superuser", "stakeholder"] search_fields = ["name"] diff --git a/ctrack/users/tests/test_models.py b/ctrack/users/tests/test_models.py index 96bd4b9..504195f 100644 --- a/ctrack/users/tests/test_models.py +++ b/ctrack/users/tests/test_models.py @@ -16,10 +16,11 @@ def test_user_is_person_object(user): assert user -def test_stakeholder_model(person): +def test_stakeholder_model(person, user): """ A stakeholder is someone who is part of the regime but also has user access to the the system. """ stakeholder = Stakeholder(person=person) - assert stakeholder + user.stakeholder = stakeholder + assert user.stakeholder.person.first_name == "Chinaplate" |