Create initial empty test cases for accounts, events and get_together apps. Fixes #22

This commit is contained in:
Michael Hall 2018-03-06 17:26:12 -08:00
parent 11da53e006
commit 4debf8e255
6 changed files with 84 additions and 6 deletions

View file

@ -1,3 +0,0 @@
from django.test import TestCase
# Create your tests here.

View file

@ -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

View file

@ -1,3 +0,0 @@
from django.test import TestCase
# Create your tests here.

16
events/tests/__init__.py Normal file
View file

@ -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

View file

@ -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")

View file

@ -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