Create initial empty test cases for accounts, events and get_together apps. Fixes #22
This commit is contained in:
parent
11da53e006
commit
4debf8e255
6 changed files with 84 additions and 6 deletions
|
@ -1,3 +0,0 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
14
accounts/tests/__init__.py
Normal file
14
accounts/tests/__init__.py
Normal 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
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
16
events/tests/__init__.py
Normal file
16
events/tests/__init__.py
Normal 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
|
||||
|
40
events/tests/federation.py
Normal file
40
events/tests/federation.py
Normal 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")
|
||||
|
14
get_together/tests/__init__.py
Normal file
14
get_together/tests/__init__.py
Normal 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
|
||||
|
Loading…
Reference in a new issue