diff options
author | Ian Kelly <ian.g.kelly@gmail.com> | 2009-07-21 21:25:48 +0000 |
---|---|---|
committer | Ian Kelly <ian.g.kelly@gmail.com> | 2009-07-21 21:25:48 +0000 |
commit | 77b269e875661d72ba7fc0926a5bb8d3d6d8b09d (patch) | |
tree | b0cadf7e65a1c58bbfdc1700b6ed076b338a03da /tests | |
parent | 72e2713d1a3563d147a1034e344335c1f7eac5ae (diff) | |
download | django-77b269e875661d72ba7fc0926a5bb8d3d6d8b09d.tar.gz |
Fixed #11487: pass long strings to Oracle as CLOB rather than NCLOB to prevent an encoding bug that occurs in some installations. Backport of [11285] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@11286 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r-- | tests/regressiontests/backends/tests.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/regressiontests/backends/tests.py b/tests/regressiontests/backends/tests.py index 5dec9feee6..03fc3ff7cd 100644 --- a/tests/regressiontests/backends/tests.py +++ b/tests/regressiontests/backends/tests.py @@ -20,7 +20,21 @@ class Callproc(unittest.TestCase): return True else: return True + +class LongString(unittest.TestCase): + def test_long_string(self): + # If the backend is Oracle, test that we can save a text longer + # than 4000 chars and read it properly + if settings.DATABASE_ENGINE == 'oracle': + c = connection.cursor() + c.execute('CREATE TABLE ltext ("TEXT" NCLOB)') + long_str = ''.join([unicode(x) for x in xrange(4000)]) + c.execute('INSERT INTO ltext VALUES (%s)',[long_str]) + c.execute('SELECT text FROM ltext') + row = c.fetchone() + c.execute('DROP TABLE ltext') + self.assertEquals(long_str, row[0].read()) if __name__ == '__main__': unittest.main() |