#13082: Backends test_long_string regression test has a bug
---------------------------------------------------+------------------------
Reporter: stvsmth | Owner: nobody
Status: new | Milestone:
Component: Testing framework | Version: 1.1
Keywords: regression backends oracle clob nclob | Stage: Unreviewed
Has_patch: 1 |
---------------------------------------------------+------------------------
In the process of tracking down an Oracle CLOB encoding issue (to be
created in another ticket once I get my head around it), I think I've
found a bug in the test_long_string regression test. Since this is an
Oracle-specific test I am guessing it doesn't get exercised that often.
The test writes a long string to the database then reads it to ensure
there are no round-trip encoding issues. The test appears to drop the
table before the read happens. You can see this bug by changing the
xrange(4000) portion of the test to xrange(40).
{{{
======================================================================
ERROR: test_long_string (regressiontests.backends.tests.LongString)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/stvsmth/code/workspaces/django-
trunk/tests/regressiontests/backends/tests.py", line 38, in
test_long_string
self.assertEquals(long_str, row[0].read())
DatabaseError: ORA-00942: table or view does not exist
}}}
It looks like the read is lazy, so the drop table command needs to happen
after the read:
{{{
36 row = c.fetchone()
37 c.execute('DROP TABLE ltext')
38 self.assertEquals(long_str, row[0].read())
}}}
The attached patch makes this simple change.
{{{
----------------------------------------------------------------------
Ran 6 tests in 0.245s
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/13082>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.