summaryrefslogtreecommitdiff
path: root/tests/test_django.py
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2014-06-21 13:32:04 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2014-06-21 13:32:04 +0200
commitd9b49c72395a82d356fc2704c9a66047f20fe983 (patch)
treebf5fdeccb1ce89008ea692d70cc01037d4b06c3b /tests/test_django.py
parentad056787937844809b48dd36311dac0f8bd4c0ab (diff)
downloadfactory-boy-d9b49c72395a82d356fc2704c9a66047f20fe983.tar
factory-boy-d9b49c72395a82d356fc2704c9a66047f20fe983.tar.gz
Provide readable errors when Meta.model isn't set (Closes #137).
Diffstat (limited to 'tests/test_django.py')
-rw-r--r--tests/test_django.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_django.py b/tests/test_django.py
index 84b0933..41a26cf 100644
--- a/tests/test_django.py
+++ b/tests/test_django.py
@@ -167,6 +167,15 @@ class WithSignalsFactory(factory.django.DjangoModelFactory):
@unittest.skipIf(django is None, "Django not installed.")
+class ModelTests(django_test.TestCase):
+ def test_unset_model(self):
+ class UnsetModelFactory(factory.django.DjangoModelFactory):
+ pass
+
+ self.assertRaises(factory.FactoryError, UnsetModelFactory.create)
+
+
+@unittest.skipIf(django is None, "Django not installed.")
class DjangoPkSequenceTestCase(django_test.TestCase):
def setUp(self):
super(DjangoPkSequenceTestCase, self).setUp()