Permalink
Browse files

Failing testcases for #22649.

  • Loading branch information...
loic committed May 18, 2014
1 parent 1d3d01b commit 5789ff73302854e60e9c9ea77c60cc4912fd97a1
Showing with 21 additions and 0 deletions.
  1. +21 −0 tests/migrations/test_operations.py
@@ -341,6 +341,12 @@ def test_add_charfield(self):
"digits",
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()
@@ -349,6 +355,7 @@ def test_add_charfield(self):
self.assertEqual(pony.text, "some text")
self.assertEqual(pony.empty, "")
self.assertEqual(pony.digits, "42")
+ self.assertEqual(pony.quotes, '"\'"')
def test_add_textfield(self):
"""
@@ -377,6 +384,12 @@ def test_add_textfield(self):
"digits",
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()
@@ -385,6 +398,7 @@ def test_add_textfield(self):
self.assertEqual(pony.text, "some text")
self.assertEqual(pony.empty, "")
self.assertEqual(pony.digits, "42")
+ self.assertEqual(pony.quotes, '"\'"')
def test_add_binaryfield(self):
"""
@@ -413,6 +427,12 @@ def test_add_binaryfield(self):
"digits",
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()
@@ -422,6 +442,7 @@ def test_add_binaryfield(self):
self.assertEqual(bytes(pony.blob), b"some text")
self.assertEqual(bytes(pony.empty), b"")
self.assertEqual(bytes(pony.digits), b"42")
+ self.assertEqual(bytes(pony.quotes), b'"\'"')
def test_column_name_quoting(self):
"""

0 comments on commit 5789ff7

Please sign in to comment.