From f02b0912b24436f5a924e839f90848ed339771f9 Mon Sep 17 00:00:00 2001 From: Rodney Folz Date: Wed, 23 Apr 2014 19:10:04 -0700 Subject: [PATCH] Failing test for Django 1.7 makemigrations ====================================================================== ERROR: test_migrate (model_utils.tests.tests.MigrationsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/user/projects/django-model-utils/model_utils/tests/tests.py", line 42, in test_migrate call_command('migrate', fake=True) File "/home/user/projects/django-model-utils/.tox/py27-trunk/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 167, in call_command return klass.execute(*args, **defaults) File "/home/user/projects/django-model-utils/.tox/py27-trunk/local/lib/python2.7/site-packages/django/core/management/base.py", line 337, in execute output = self.handle(*args, **options) File "/home/user/projects/django-model-utils/.tox/py27-trunk/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 138, in handle ProjectState.from_apps(apps), File "/home/user/projects/django-model-utils/.tox/py27-trunk/local/lib/python2.7/site-packages/django/db/migrations/state.py", line 71, in from_apps model_state = ModelState.from_model(model) File "/home/user/projects/django-model-utils/.tox/py27-trunk/local/lib/python2.7/site-packages/django/db/migrations/state.py", line 136, in from_model e, TypeError: Couldn't reconstruct field name_changed on tests.Monitored: MonitorField requires a "monitor" argument --- model_utils/tests/tests.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/model_utils/tests/tests.py b/model_utils/tests/tests.py index 640fcc1..38150a8 100644 --- a/model_utils/tests/tests.py +++ b/model_utils/tests/tests.py @@ -12,6 +12,7 @@ from django.db import models from django.db.models.fields import FieldDoesNotExist from django.utils.six import text_type from django.core.exceptions import ImproperlyConfigured, FieldError +from django.core.management import call_command from django.test import TestCase from model_utils import Choices, FieldTracker @@ -31,6 +32,12 @@ from model_utils.tests.models import ( InheritanceManagerTestChild3, StatusFieldChoicesName) +class MigrationsTests(TestCase): + @skipUnless(django.VERSION >= (1, 7, 0), "test only applies to Django 1.7+") + def test_makemigrations(self): + call_command('makemigrations', dry_run=True) + + class GetExcerptTests(TestCase): def test_split(self): e = get_excerpt("some content\n\n\n\nsome more")