Fixed #23894 -- Made deconstruct methods favor kwargs over args

This commit is contained in:
Markus Holtermann 2014-11-22 18:57:13 +01:00 committed by Tim Graham
parent e023ceb453
commit 912ad03226
6 changed files with 182 additions and 41 deletions

View file

@ -6,7 +6,6 @@ from django.contrib.postgres.forms import SimpleArrayField, SplitArrayField
from django.core import exceptions, serializers
from django.core.management import call_command
from django.db import models, IntegrityError, connection
from django.db.migrations.writer import MigrationWriter
from django import forms
from django.test import TestCase, override_settings
from django.utils import timezone
@ -229,11 +228,6 @@ class TestMigrations(TestCase):
new = ArrayField(*args, **kwargs)
self.assertEqual(new.base_field.max_length, field.base_field.max_length)
def test_makemigrations(self):
field = ArrayField(models.CharField(max_length=20))
statement, imports = MigrationWriter.serialize(field)
self.assertEqual(statement, 'django.contrib.postgres.fields.ArrayField(models.CharField(max_length=20), size=None)')
@override_settings(MIGRATION_MODULES={
"postgres_tests": "postgres_tests.array_default_migrations",
})