Ticket #11487: base_with_tests.diff
File base_with_tests.diff, 1.9 KB (added by , 15 years ago) |
---|
-
django/db/backends/oracle/base.py
360 360 # If parameter has `input_size` attribute, use that. 361 361 self.input_size = param.input_size 362 362 elif isinstance(param, basestring) and len(param) > 4000: 363 # Mark any string param greater than 4000 characters as a n NCLOB.364 self.input_size = Database. NCLOB363 # Mark any string param greater than 4000 characters as a CLOB. 364 self.input_size = Database.CLOB 365 365 else: 366 366 self.input_size = None 367 367 -
tests/regressiontests/backends/tests.py
17 17 return True 18 18 else: 19 19 return True 20 21 class LongString(unittest.TestCase): 20 22 23 def test_long_string(self): 24 # If the backend is Oracle, test that we can save a text longer 25 # than 4000 chars and read it properly 26 if settings.DATABASE_ENGINE == 'oracle': 27 c = connection.cursor() 28 c.execute('CREATE TABLE ltext ("TEXT" CLOB)') 29 transaction.commit_unless_managed() 30 long_str = ''.join( unicode(x) for x in xrange(4000) ) 31 c.execute('INSERT INTO ltext VALUES (%s)',[long_str]) 32 transaction.commit_unless_managed() 33 c.execute('SELECT text FROM ltext') 34 row = c.fetchone() 35 c.execute('DROP TABLE ltext') 36 transaction.commit_unless_managed() 37 self.assertEquals(long_str, row[0].read()) 38 21 39 def connection_created_test(sender, **kwargs): 22 40 print 'connection_created signal' 23 41