Tests introduced in patch for #17327 causing errors

57 views
Skip to first unread message

Ryan Kaskel

unread,
Mar 7, 2012, 3:40:56 AM3/7/12
to django-d...@googlegroups.com
Hi all.

I've pulled in the latest changes and it seems like ticket #17327 [1] introduces a few new tests that are raising errors when I run contrib.auth tests via my project:

- auth.MultiDBChangepasswordManagementCommandTestCase.test_that_changepassword_command_with_database_option_uses_given_db
- auth.MultiDBCreatesuperuserTestCase.test_createsuperuser_command_with_database_option

They raise: ConnectionDoesNotExist: The connection other doesn't exist.

The issue is that the tests assume there there is a database called "other," which my test settings didn't have. If I add a database "other" in my test settings, the tests pass.

I've played around with override_settings but I'm not sure if that would work here. What I've tried so far doesn't.

Any tips?

Thanks,
Ryan Kaskel

Ryan Kaskel

unread,
Mar 7, 2012, 4:42:36 AM3/7/12
to django-d...@googlegroups.com
In addition to the above (which I can confirm causes tests to fail in a new project), I also goofed up a patch related to a different set of auth tests. I've created #17848 (release blocker) to fix this. [1]

Ticket #16366 [2] required the template context processor cache to be cleared. The code resets the cache but fails to restore it. If the auth tests run first, this causes many other test failures in my project because the newly cached template context processors only include the Django defaults.

The general issue of having to reset this cache (and others) is in ticket #17787 which targets a later release. [3]

I'm sorry about that error and I hope it isn't too late to include the patch. I think it will cause many headaches for other people.

I know we shouldn't post about tickets we write but given 1.4 is going to be released in a few days, I think it's important to bring this up.

Best,
Ryan Kaskel

Calvin Cheng

unread,
Mar 7, 2012, 10:11:50 AM3/7/12
to django-d...@googlegroups.com

Thanks. I stumbled upon the same problem.

Brian Riley

unread,
Mar 7, 2012, 11:11:05 AM3/7/12
to django-d...@googlegroups.com
Thanks for catching this. I worked on that patch.

The problem is that those two test cases shouldn't be in the auth tests but rather somewhere in top-level tests folder (with the other multi DB tests). I'm not sure exactly where they belong though. If a core dev wants to chime in and suggest a location, I'd be happy to move them and submit the patch.

Brian
--
You received this message because you are subscribed to the Google Groups "Django developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-developers/-/JXXZeiJ5SQgJ.
To post to this group, send email to django-d...@googlegroups.com.
To unsubscribe from this group, send email to django-develop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.

Brian Riley

unread,
Mar 7, 2012, 6:38:15 PM3/7/12
to django-d...@googlegroups.com
I added a new patch to move these two failing tests to regressiontests--where they get run with the correct settings and pass.


If this isn't the proper place for management command tests like this, I'll move them to wherever is more appropriate.

Brian
Reply all
Reply to author
Forward
0 new messages