Django unittest failure

56 views
Skip to first unread message

Ryan Boggs

unread,
Sep 14, 2013, 6:35:06 PM9/14/13
to django...@googlegroups.com
Hi,

I am trying to update Django in OpenBSD ports and I am experiencing a unit test failure when testing django 1.5.2/1.5.3 on the latest snapshot of OpenBSD.  The failure is with test:
django.contrib.formtools.tests.wizard.wizardtests.tests.WizardFormKwargsOverrideTests.test_instance_is_maintained
AssertionError: 2 != 3

I've attached a screenshot with more details regarding this failure if it can be helpful.  This failure was not present with version 1.5.1.  Does anyone know if a setting needs to be adjusted that I may be missing?

Please let me know if more details are needed.

Thanks,
Ryan
django_test_fail.png

Kelvin Wong

unread,
Sep 14, 2013, 8:47:09 PM9/14/13
to django...@googlegroups.com
Are you reusing an old database or something? There should be only two users in the database prior to testing that section.

# Create two users so we can filter by is_staff when handing our
# wizard a queryset keyword argument.
self.normal_user = User.objects.create(username='test1', email='nor...@example.com')
self.staff_user = User.objects.create(username='test2', email='st...@example.com', is_staff=True)

See line 369


K



On Saturday, September 14, 2013 3:35:06 PM UTC-7, Ryan Boggs wrote:

AssertionError: 2 != 3

Ryan Boggs

unread,
Sep 15, 2013, 12:57:42 AM9/15/13
to django...@googlegroups.com
Hi,

Thank you for responding.

We are using the test_sqlite.py as the settings file for the regression tests, which I believe should be creating new sqlite databases in memory.  So there shouldn't be any old database files being used.

We are using the same procedure as we did with 1.5.1 and I didn't see any test failures with that version on OpenBSD.

Thanks,
Ryan

Ryan Boggs

unread,
Sep 15, 2013, 3:30:54 PM9/15/13
to django...@googlegroups.com
FYI,

Just tried with 1.5.4 and the same test is still failing.

Thanks,
Ryan

Kelvin Wong

unread,
Sep 16, 2013, 10:16:25 PM9/16/13
to django...@googlegroups.com
You should probably open a bug on this issue. The test suite fails for me on MacOS/Python 2.7 on the stable/1.5.x branch. This is the command that fails reliably on my machine:

$ PYTHONPATH=..:$PYTHONPATH python ./runtests.py --settings=test_sqlite utils formtools

It might be related to this addition


The user created by this line (l.129):

user = User.objects.create_user('johndoe', 'jo...@example.com', 'pass')

... persists into subsequent WizardFormKwargsOverrideTests tests on the stable/1.5.x branch

Running the individual test for 'formtools' passes without issue.

K

Ryan Boggs

unread,
Sep 17, 2013, 10:18:29 PM9/17/13
to django...@googlegroups.com
I reported it.  #21118.

Thanks for taking a look at this.

Thanks,
Ryan
Reply all
Reply to author
Forward
0 new messages