Michael Manfre  committed 269edd8

Add tests to show adodbapi failure to convert SafeString and SafeUnicode objects.

  • Participants
  • Parent commits 50a5042

Comments (1)

Files changed (2)

File tests/test_main/regressiontests/

     Simple table consisting of only an Integer ID primary key
     id = models.IntegerField(primary_key=True)
+class StringTable(models.Model):
+    name = models.CharField(max_length=50)

File tests/test_main/regressiontests/

 from django.core.exceptions import ImproperlyConfigured
 from django.db import models, connection
 from django.test import TestCase
+from django.utils.safestring import mark_safe
-from regressiontests.models import Bug69Table1, Bug69Table2, Bug70Table, Bug93Table, IntegerIdTable
+from regressiontests.models import Bug69Table1, Bug69Table2, Bug70Table, Bug93Table, IntegerIdTable, StringTable
 class Bug38Table(models.Model):
     d = models.DecimalField(max_digits=5, decimal_places=2)
         for val, expected in pairs:
             self.assertEqual(expected, _re_data_type_terminator.split(val)[0])
+class SafeStringTestCase(TestCase):
+    def test_ascii(self):
+        obj = StringTable(name=mark_safe('string'))
+        self.assertEqual(str(, str(StringTable.objects.get(
+    def test_unicode(self):
+        obj = StringTable(name=mark_safe(u'string'))
+        self.assertEqual(unicode(, unicode(StringTable.objects.get(