Bufix, i guess
This commit is contained in:
parent
bf07795f4d
commit
2837999a5b
@ -1,6 +1,7 @@
|
|||||||
from django.db import models
|
from django.db import models as django_models
|
||||||
from lostplaces_app.models import Explorer
|
from lostplaces_app.models import Explorer
|
||||||
|
|
||||||
|
|
||||||
def mock_user():
|
def mock_user():
|
||||||
explorer_list = Explorer.objects.all()
|
explorer_list = Explorer.objects.all()
|
||||||
if len(explorer_list) <= 0:
|
if len(explorer_list) <= 0:
|
||||||
@ -17,14 +18,14 @@ class TestSubmittable:
|
|||||||
def test_submitted_when(self):
|
def test_submitted_when(self):
|
||||||
submitted_when = self.object._meta.get_field('submitted_when')
|
submitted_when = self.object._meta.get_field('submitted_when')
|
||||||
self.assertTrue(submitted_when)
|
self.assertTrue(submitted_when)
|
||||||
self.assertEqual(type(submitted_when), models.DateTimeField)
|
self.assertEqual(type(submitted_when), django_models.DateTimeField)
|
||||||
self.assertTrue(submitted_when.auto_now_add)
|
self.assertTrue(submitted_when.auto_now_add)
|
||||||
|
|
||||||
def test_submitted_by(self):
|
def test_submitted_by(self):
|
||||||
submitted_by = self.object._meta.get_field('submitted_by')
|
submitted_by = self.object._meta.get_field('submitted_by')
|
||||||
self.assertTrue(submitted_by)
|
self.assertTrue(submitted_by)
|
||||||
self.assertEqual(type(submitted_by), models.ForeignKey)
|
self.assertEqual(type(submitted_by), django_models.ForeignKey)
|
||||||
self.assertEqual(submitted_by.remote_field.related_name, 'places')
|
self.assertEqual(submitted_by.remote_field.related_name, 'places')
|
||||||
self.assertTrue(submitted_by.null)
|
self.assertTrue(submitted_by.null)
|
||||||
self.assertTrue(submitted_by.blank)
|
self.assertTrue(submitted_by.blank)
|
||||||
self.assertEqual(submitted_by.remote_field.on_delete, models.SET_NULL)
|
self.assertEqual(submitted_by.remote_field.on_delete, django_models.SET_NULL)
|
Loading…
Reference in New Issue
Block a user