I have django-nose 1.0 installed as the test runner for a Django 1.3.1 project. I'm following the instructions on the pypi page regarding test-only models.
Here is my settings.py testrunner config:
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
I've run tests for several months using this testrunner without issue. Now I'm trying to test an abstract class, and I'm using a test-only model, but the specific test I've written throws an error.
According to the documentation, I only need to include the test class in one of the files that is imported during testing. I have the tests sitting in a 'tests' folder and broken out into several smaller testing files. Here is my tests/model_tests.py (models and app intentionally renamed for work reasons):
from django.tests import TestCase
from myapp.models import AbstractFoo
class Foo(AbstractFoo):
pass
class TestFoo(TestCase):
def setUp(self):
self.foo = Foo.objects.create(name="Tester",
description="This is a test", ...)
... [tests follow]
I'm receiving an error in the first line of setUp:
DatabaseError: relation "tests_foo" does not exist
LINE 1: INSERT INTO "tests_foo" ("name", "description", "display...
And if I put a break point into the test and inspect the database, the table 'tests_foo' (or any table with 'foo' in the name) does not exist.
Any ideas about why the test-only model isn't loading?