From d9b49c72395a82d356fc2704c9a66047f20fe983 Mon Sep 17 00:00:00 2001 From: Raphaƫl Barrois Date: Sat, 21 Jun 2014 13:32:04 +0200 Subject: Provide readable errors when Meta.model isn't set (Closes #137). --- tests/test_django.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') 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 @@ -166,6 +166,15 @@ class WithSignalsFactory(factory.django.DjangoModelFactory): model = models.WithSignals +@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): -- cgit v1.2.3