aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/users/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ctrack/users/tests')
-rw-r--r--ctrack/users/tests/factories.py1
-rw-r--r--ctrack/users/tests/test_models.py2
-rw-r--r--ctrack/users/tests/test_views.py10
3 files changed, 3 insertions, 10 deletions
diff --git a/ctrack/users/tests/factories.py b/ctrack/users/tests/factories.py
index 700d9b4..b4ddad0 100644
--- a/ctrack/users/tests/factories.py
+++ b/ctrack/users/tests/factories.py
@@ -8,7 +8,6 @@ class UserFactory(DjangoModelFactory):
username = Faker("user_name")
email = Faker("email")
name = Faker("name")
- oes_user = False
@post_generation
def password(self, create: bool, extracted: Sequence[Any], **kwargs):
diff --git a/ctrack/users/tests/test_models.py b/ctrack/users/tests/test_models.py
index fb2eade..c429b9c 100644
--- a/ctrack/users/tests/test_models.py
+++ b/ctrack/users/tests/test_models.py
@@ -13,4 +13,4 @@ def test_user_is_person_object(user: User):
"""User comes from ctrack.conftest.
"""
- assert user.oes_user is False
+ assert user
diff --git a/ctrack/users/tests/test_views.py b/ctrack/users/tests/test_views.py
index 8b923f6..561c540 100644
--- a/ctrack/users/tests/test_views.py
+++ b/ctrack/users/tests/test_views.py
@@ -53,13 +53,8 @@ def test_profile_view_contains_organisation_information():
This is where users are redirected to when they log in and where I want to capture
information about the user - particularly if they are an OES user.
"""
- org = OrganisationFactory.create()
user = get_user_model().objects.create_user(
- username="testy",
- email="testy@test.com",
- password="test1020",
- oes_user=True,
- organisation=org,
+ username="testy", email="testy@test.com", password="test1020"
)
factory = RequestFactory()
request = factory.get(f"/users/{user.username}")
@@ -68,6 +63,5 @@ def test_profile_view_contains_organisation_information():
request.user = user
response = UserDetailView.as_view()(request, username=user.username)
assert response.status_code == 200
- assert response.context_data["object"].oes_user is True
# TODO - work out how we can attach an organisation to the User model
- assert response.context_data["object"].organisation.name == org.name
+ assert response.context_data["object"]