On 10 heinä, 00:35, Ramiro Morales <[email protected]> wrote: > On Mon, May 7, 2012 at 6:50 PM, Anssi Kääriäinen > > <[email protected]> wrote: > > > I would like to just get rid of the sequence resets. Oracle doesn't do > > it currently, TestCase doesn't do it, and IMO assuming the IDs are > > going to start from 1 is an assumption one should not make. > > > Objections to just getting rid of the sequence resets altogether (with > > the opt-in flag)? > > Hi all, > > Based on Andreas' work and discussion on this thread, I've: > > 1. If the user specifies the `reset_sequences` flag, what is performed > during test case setup is actually that: A reset of DB sequences. > There is no more flushing of tables. > > For this a method was added to DB backends DatabaseOperation classes. > > 2. Dropped resetting of sequences from the DB flush now performed during > test case teardown code. For this, a stealth option was added to the > `flush` management command. > > 3. Expanded and re-factored [related] documentation a bit. > > 1. and 2. mean that now: > > * Pre test case execution: There is no DB table flushing nor reset of > sequences (the latter can be asked for the developer by using > reset_sequences. > > * Post test case execution: Flushing of DB tables is performed. > > https://github.com/ramiro/django/compare/pr45_t18271 > > So far, I count two favorable from core devs: Karen and Anssi. > > Any further feedback about the proposed changes is welcome. > Especially reports of results of people running their own test suites. > > I ran the Django test suite w/o against Postgres, MySQL and sqlite3 > w/o problems. > > Hopefully I will be able to commit something along the lines soon.
I don't know if this is the proper forum to give a review... but here goes anyways :) I spotted one error: https://github.com/ramiro/django/compare/pr45_t18271#L7R472 - The line should say conn.cursor(), not connection.cursor(). And a question: This change in https://github.com/ramiro/django/compare/pr45_t18271#L9R502 says that changing a TestCase to TransactionTestCase might solve some errors caused by test ordering. I don't get why this is true. I ran the full test suite on SQLite, and got this error: ====================================================================== ERROR: test_pass_connection_between_threads (regressiontests.backends.tests.ThreadTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/akaariai/Programming/django/tests/regressiontests/ backends/tests.py", line 595, in test_pass_connection_between_threads self.assertTrue(isinstance(exceptions[0], DatabaseError)) IndexError: list index out of range I don't know if this is related to this patch or not. The error does not happen when running the backends test alone. This might be related to test ordering, or just a random test failure (one which I haven't seen before, though). I have no time to rerun the full test suite just now. - Anssi -- You received this message because you are subscribed to the Google Groups "Django developers" 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-developers?hl=en.
