From 647be06538474078ac79c1338f02f5d9bc56a79b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pave=C5=82=20Ty=C5=9Blacki?= Date: Thu, 10 Jan 2019 22:06:17 +0300 Subject: [PATCH] Renamed variables after generalization of constraints. Follow up to 8eae094638acf802c8047b341d126d94bc9b45a3. --- django/db/backends/base/schema.py | 2 +- tests/constraints/tests.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py index 55835fe535..bc8e54989e 100644 --- a/django/db/backends/base/schema.py +++ b/django/db/backends/base/schema.py @@ -292,7 +292,7 @@ class BaseDatabaseSchemaEditor: for fields in model._meta.unique_together: columns = [model._meta.get_field(field).column for field in fields] self.deferred_sql.append(self._create_unique_sql(model, columns)) - constraints = [check.constraint_sql(model, self) for check in model._meta.constraints] + constraints = [constraint.constraint_sql(model, self) for constraint in model._meta.constraints] # Make the table sql = self.sql_create_table % { "table": self.quote_name(model._meta.db_table), diff --git a/tests/constraints/tests.py b/tests/constraints/tests.py index 995c5f461c..c6a36ade07 100644 --- a/tests/constraints/tests.py +++ b/tests/constraints/tests.py @@ -80,8 +80,8 @@ class UniqueConstraintTests(TestCase): def test_deconstruction(self): fields = ['foo', 'bar'] name = 'unique_fields' - check = models.UniqueConstraint(fields=fields, name=name) - path, args, kwargs = check.deconstruct() + constraint = models.UniqueConstraint(fields=fields, name=name) + path, args, kwargs = constraint.deconstruct() self.assertEqual(path, 'django.db.models.UniqueConstraint') self.assertEqual(args, ()) self.assertEqual(kwargs, {'fields': tuple(fields), 'name': name})