aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/organisations
diff options
context:
space:
mode:
Diffstat (limited to 'ctrack/organisations')
-rw-r--r--ctrack/organisations/tests/factories.py13
-rw-r--r--ctrack/organisations/tests/test_factories.py11
-rw-r--r--ctrack/organisations/tests/test_views.py10
3 files changed, 29 insertions, 5 deletions
diff --git a/ctrack/organisations/tests/factories.py b/ctrack/organisations/tests/factories.py
index c8340b9..330ad79 100644
--- a/ctrack/organisations/tests/factories.py
+++ b/ctrack/organisations/tests/factories.py
@@ -7,6 +7,7 @@ from factory import Faker, SubFactory, post_generation
from factory.django import DjangoModelFactory
from ctrack.organisations.models import Address, Organisation, Person, Role
+from ctrack.register.models import SingleDateTimeEvent
from ctrack.users.tests.factories import UserFactory
User = get_user_model()
@@ -119,3 +120,15 @@ class AddressFactory(DjangoModelFactory):
class Meta:
model = Address
+
+
+class SingleDateTimeEventFactory(DjangoModelFactory):
+ type_descriptor = None # must pass this in
+ short_description = "Nothing short description"
+ datetime = "2020-02-10 10:00"
+ comments = "Nothing comments"
+ location = "Gark's basin"
+ user = SubFactory(UserFactory)
+
+ class Meta:
+ model = SingleDateTimeEvent
diff --git a/ctrack/organisations/tests/test_factories.py b/ctrack/organisations/tests/test_factories.py
index 227d7db..0b793c3 100644
--- a/ctrack/organisations/tests/test_factories.py
+++ b/ctrack/organisations/tests/test_factories.py
@@ -1,9 +1,13 @@
+import pytest
+
from ctrack.organisations.tests.factories import (
OrganisationFactory,
PersonFactory,
- RoleFactory,
+ RoleFactory, SingleDateTimeEventFactory,
)
+pytestmark = pytest.mark.django_db
+
def test_organisation_factory():
o = OrganisationFactory.build()
@@ -19,3 +23,8 @@ def test_person_factory():
r = RoleFactory.build()
p = PersonFactory.build(role=r, predecessor__predecessor=None)
assert p.first_name
+
+
+def test_meeting_event_factory():
+ meeting = SingleDateTimeEventFactory.create(type_descriptor="MEETING")
+ assert meeting.type_descriptor == "MEETING"
diff --git a/ctrack/organisations/tests/test_views.py b/ctrack/organisations/tests/test_views.py
index 85ccc5a..6ae9ff8 100644
--- a/ctrack/organisations/tests/test_views.py
+++ b/ctrack/organisations/tests/test_views.py
@@ -5,8 +5,7 @@ from django.test import RequestFactory
from django.urls import reverse
from ctrack.caf.tests.factories import PersonFactory
-from ctrack.organisations.models import Mode, Submode
-from ctrack.organisations.tests.factories import OrganisationFactory, RoleFactory
+from ctrack.organisations.tests.factories import OrganisationFactory
from ctrack.organisations.views import IncidentReportCreateView
from ..views import OrganisationListView
@@ -14,9 +13,13 @@ from ..views import OrganisationListView
pytestmark = pytest.mark.django_db
+# TODO - come back to this
+def test_meetings_in_organisation_detail_view(user, client):
+ pass
+
+
# https://docs.djangoproject.com/en/3.0/topics/testing/advanced/#example
def test_organisation_list_view():
-
OrganisationFactory.create()
OrganisationFactory.create()
OrganisationFactory.create()
@@ -39,7 +42,6 @@ def test_organisation_list_view():
def test_only_member_of_cct_user_group_can_view_org_list():
-
OrganisationFactory.create()
OrganisationFactory.create()
OrganisationFactory.create()