summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Charette <charettes@users.noreply.github.com>2016-04-27 16:17:22 -0400
committerSimon Charette <charettes@users.noreply.github.com>2016-04-27 16:17:22 -0400
commita877a2f83da384944ad6530eb951bcd55dcd8605 (patch)
tree90bc2de6ade04ff8d1422b28b43bb70fc6ab79dc /tests
parentfed7004b8a0658d9f898c7139e127a17deff7bba (diff)
Refs #26521 -- Added the duplicated value to CreateModel validation messages.
Thanks Tim for the suggestion.
Diffstat (limited to 'tests')
-rw-r--r--tests/migrations/test_operations.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py
index 2df12fed8f..d34a6a4284 100644
--- a/tests/migrations/test_operations.py
+++ b/tests/migrations/test_operations.py
@@ -201,7 +201,7 @@ class OperationTests(OperationTestBase):
self.assertNotIn('managers', definition[2])
def test_create_model_with_duplicate_field_name(self):
- with self.assertRaisesMessage(ValueError, "Found duplicate field in CreateModel operation."):
+ with self.assertRaisesMessage(ValueError, 'Found duplicate value pink in CreateModel fields argument.'):
migrations.CreateModel(
"Pony",
[
@@ -212,31 +212,33 @@ class OperationTests(OperationTestBase):
)
def test_create_model_with_duplicate_base(self):
- with self.assertRaisesMessage(ValueError, "Found duplicate base in CreateModel operation."):
+ message = 'Found duplicate value test_crmo.pony in CreateModel bases argument.'
+ with self.assertRaisesMessage(ValueError, message):
migrations.CreateModel(
"Pony",
fields=[],
bases=("test_crmo.Pony", "test_crmo.Pony",),
)
- with self.assertRaisesMessage(ValueError, "Found duplicate base in CreateModel operation."):
+ with self.assertRaisesMessage(ValueError, message):
migrations.CreateModel(
"Pony",
fields=[],
- bases=(UnicodeModel, UnicodeModel,),
+ bases=("test_crmo.Pony", "test_crmo.pony",),
)
- with self.assertRaisesMessage(ValueError, "Found duplicate base in CreateModel operation."):
+ message = 'Found duplicate value migrations.unicodemodel in CreateModel bases argument.'
+ with self.assertRaisesMessage(ValueError, message):
migrations.CreateModel(
"Pony",
fields=[],
- bases=("test_crmo.Pony", "test_crmo.pony",),
+ bases=(UnicodeModel, UnicodeModel,),
)
- with self.assertRaisesMessage(ValueError, "Found duplicate base in CreateModel operation."):
+ with self.assertRaisesMessage(ValueError, message):
migrations.CreateModel(
"Pony",
fields=[],
bases=(UnicodeModel, 'migrations.unicodemodel',),
)
- with self.assertRaisesMessage(ValueError, "Found duplicate base in CreateModel operation."):
+ with self.assertRaisesMessage(ValueError, message):
migrations.CreateModel(
"Pony",
fields=[],
@@ -244,7 +246,7 @@ class OperationTests(OperationTestBase):
)
def test_create_model_with_duplicate_manager_name(self):
- with self.assertRaisesMessage(ValueError, "Found duplicate manager in CreateModel operation."):
+ with self.assertRaisesMessage(ValueError, 'Found duplicate value objects in CreateModel managers argument.'):
migrations.CreateModel(
"Pony",
fields=[],