aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/register/tests/test_views.py
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-10-12 20:33:04 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-10-12 20:33:04 +0100
commit29028b60b46693c2ad9e786a61bd5e94bf6c7fa6 (patch)
tree4c22a1ad582bd523e223a589eaab779a4e13a55a /ctrack/register/tests/test_views.py
parent7bec7a48f26fb5671c5c05ea28f1a631c742728d (diff)
first view test for events
Diffstat (limited to 'ctrack/register/tests/test_views.py')
-rw-r--r--ctrack/register/tests/test_views.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/ctrack/register/tests/test_views.py b/ctrack/register/tests/test_views.py
new file mode 100644
index 0000000..51fceac
--- /dev/null
+++ b/ctrack/register/tests/test_views.py
@@ -0,0 +1,18 @@
+import pytest
+
+from ctrack.register.views import SingleDateTimeEventCreate
+
+pytestmark = pytest.mark.django_db
+
+
+class TestSingleDateFormView:
+ def test_single_datetime_event_form(self, user, request_factory):
+ view = SingleDateTimeEventCreate()
+ request = request_factory.get("/register/event/create-single-datetime/")
+ request.user = user
+ view.request = request
+ response = SingleDateTimeEventCreate.as_view()(request)
+ assert response.status_code == 200
+ assert not response.context_data["form"].is_bound
+ for k in ["type_descriptor", "short_description", "datetime", "comments", "location"]:
+ assert k in response.context_data["form"].fields