Failing testcases for #22649.

This commit is contained in:
Loic Bistuer 2014-05-18 12:46:12 +07:00
parent 1d3d01b4f7
commit 5789ff7330
1 changed files with 21 additions and 0 deletions

View File

@ -341,6 +341,12 @@ class OperationTests(MigrationTestBase):
"digits", "digits",
models.CharField(max_length=10, default="42"), models.CharField(max_length=10, default="42"),
), ),
# Manual quoting is fragile and could trip on quotes. Refs #xyz.
migrations.AddField(
"Pony",
"quotes",
models.CharField(max_length=10, default='"\'"'),
),
]) ])
new_apps = new_state.render() new_apps = new_state.render()
@ -349,6 +355,7 @@ class OperationTests(MigrationTestBase):
self.assertEqual(pony.text, "some text") self.assertEqual(pony.text, "some text")
self.assertEqual(pony.empty, "") self.assertEqual(pony.empty, "")
self.assertEqual(pony.digits, "42") self.assertEqual(pony.digits, "42")
self.assertEqual(pony.quotes, '"\'"')
def test_add_textfield(self): def test_add_textfield(self):
""" """
@ -377,6 +384,12 @@ class OperationTests(MigrationTestBase):
"digits", "digits",
models.TextField(default="42"), models.TextField(default="42"),
), ),
# Manual quoting is fragile and could trip on quotes. Refs #xyz.
migrations.AddField(
"Pony",
"quotes",
models.TextField(default='"\'"'),
),
]) ])
new_apps = new_state.render() new_apps = new_state.render()
@ -385,6 +398,7 @@ class OperationTests(MigrationTestBase):
self.assertEqual(pony.text, "some text") self.assertEqual(pony.text, "some text")
self.assertEqual(pony.empty, "") self.assertEqual(pony.empty, "")
self.assertEqual(pony.digits, "42") self.assertEqual(pony.digits, "42")
self.assertEqual(pony.quotes, '"\'"')
def test_add_binaryfield(self): def test_add_binaryfield(self):
""" """
@ -413,6 +427,12 @@ class OperationTests(MigrationTestBase):
"digits", "digits",
models.BinaryField(default=b"42"), models.BinaryField(default=b"42"),
), ),
# Manual quoting is fragile and could trip on quotes. Refs #xyz.
migrations.AddField(
"Pony",
"quotes",
models.BinaryField(default=b'"\'"'),
),
]) ])
new_apps = new_state.render() new_apps = new_state.render()
@ -422,6 +442,7 @@ class OperationTests(MigrationTestBase):
self.assertEqual(bytes(pony.blob), b"some text") self.assertEqual(bytes(pony.blob), b"some text")
self.assertEqual(bytes(pony.empty), b"") self.assertEqual(bytes(pony.empty), b"")
self.assertEqual(bytes(pony.digits), b"42") self.assertEqual(bytes(pony.digits), b"42")
self.assertEqual(bytes(pony.quotes), b'"\'"')
def test_column_name_quoting(self): def test_column_name_quoting(self):
""" """