From 4debf8e25562ce89e24857ff996bfb853bbc684d Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Tue, 6 Mar 2018 17:26:12 -0800 Subject: [PATCH] Create initial empty test cases for accounts, events and get_together apps. Fixes #22 --- accounts/tests.py | 3 --- accounts/tests/__init__.py | 14 ++++++++++++ events/tests.py | 3 --- events/tests/__init__.py | 16 ++++++++++++++ events/tests/federation.py | 40 ++++++++++++++++++++++++++++++++++ get_together/tests/__init__.py | 14 ++++++++++++ 6 files changed, 84 insertions(+), 6 deletions(-) delete mode 100644 accounts/tests.py create mode 100644 accounts/tests/__init__.py delete mode 100644 events/tests.py create mode 100644 events/tests/__init__.py create mode 100644 events/tests/federation.py create mode 100644 get_together/tests/__init__.py diff --git a/accounts/tests.py b/accounts/tests.py deleted file mode 100644 index 7ce503c..0000000 --- a/accounts/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/accounts/tests/__init__.py b/accounts/tests/__init__.py new file mode 100644 index 0000000..d849e25 --- /dev/null +++ b/accounts/tests/__init__.py @@ -0,0 +1,14 @@ +from django.test import TestCase + +# Create your tests here. +class BaseTest(TestCase): + + def setUp(self): + super().setUp() + + def tearDown(self): + super().tearDown() + + def test_harness(self): + return + diff --git a/events/tests.py b/events/tests.py deleted file mode 100644 index 7ce503c..0000000 --- a/events/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/events/tests/__init__.py b/events/tests/__init__.py new file mode 100644 index 0000000..69a3a05 --- /dev/null +++ b/events/tests/__init__.py @@ -0,0 +1,16 @@ +from django.test import TestCase + +from .federation import * + +# Create your tests here. +class BaseTest(TestCase): + + def setUp(self): + super().setUp() + + def tearDown(self): + super().tearDown() + + def test_harness(self): + return + diff --git a/events/tests/federation.py b/events/tests/federation.py new file mode 100644 index 0000000..4a9c50f --- /dev/null +++ b/events/tests/federation.py @@ -0,0 +1,40 @@ +from django.test import TestCase +from model_mommy import mommy + +from ..models.events import Event +from ..models.search import Searchable + +# Create your tests here. +class SearchableCreationTest(TestCase): + + def setUp(self): + super().setUp() + + def tearDown(self): + super().tearDown() + + def test_searchable_creation(self): + searchables = Searchable.objects.all() + assert(searchables.count() == 0) + + event = mommy.make(Event) + event.save() + + searchables = Searchable.objects.all() + assert(searchables.count() == 1) + + def test_searchable_update(self): + event = mommy.make(Event, name="Old Title") + event.save() + + searchables = Searchable.objects.all() + assert(searchables.count() == 1) + assert(searchables[0].event_title == "Old Title") + + event.name = "New Title" + event.save() + + searchables = Searchable.objects.all() + assert(searchables.count() == 1) + assert(searchables[0].event_title == "New Title") + diff --git a/get_together/tests/__init__.py b/get_together/tests/__init__.py new file mode 100644 index 0000000..d849e25 --- /dev/null +++ b/get_together/tests/__init__.py @@ -0,0 +1,14 @@ +from django.test import TestCase + +# Create your tests here. +class BaseTest(TestCase): + + def setUp(self): + super().setUp() + + def tearDown(self): + super().tearDown() + + def test_harness(self): + return +