shaib avatar shaib committed ef6ae33

Fix char-to-text test to support lazy strings in text fields.

Comments (0)

Files changed (1)

south/tests/db.py

         db.execute("INSERT INTO test_text_to_char VALUES (%s)", [value])
         db.alter_column("test_text_to_char", "textcol", models.CharField(max_length=100))
         after = db.execute("select * from test_text_to_char")[0][0]
-        self.assertEqual(value, after, "Change from text to char altered value")
+        self.assertEqual(value, after, "Change from text to char altered value [ %s != %s ]" % (`value`,`after`))
 
     def test_char_to_text(self):
         """
-        On Oracle, you can't simply ALTER TABLE MODIFY a textfield to a charfield
+        On Oracle, you can't simply ALTER TABLE MODIFY a charfield to a textfield either
         """
         value = "agnabawak"
         db.create_table("test_char_to_text", [
         db.execute("INSERT INTO test_char_to_text VALUES (%s)", [value])
         db.alter_column("test_char_to_text", "textcol", models.TextField())
         after = db.execute("select * from test_char_to_text")[0][0]
-        self.assertEqual(value, after, "Change from char to text altered value")
+        after = unicode(after) # Oracle text fields return a sort of lazy string -- force evaluation
+        self.assertEqual(value, after, "Change from char to text altered value [ %s != %s ]" % (`value`,`after`))
 
     def test_datetime_default(self):
         """
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.