Opened 16 years ago
Closed 12 years ago
#10853 closed Bug (fixed)
Django unit test fails when using the dummy cache backend.
Reported by: | Stavros Korokithakis | Owned by: | nobody |
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When using the dummy cache backend, the test that tests the cache fails (understandably), but it's annoying to have a test fail when this is the indended behaviour. Shouldn't this check for the dummy backend and not run the test (or expect the test to fail) if so?
====================================================================== FAIL: Doctest: django.contrib.sessions.tests ---------------------------------------------------------------------- Traceback (most recent call last): File "/Library/Python/2.5/site-packages/django/test/_doctest.py", line 2180, in runTest raise self.failureException(self.format_failure(new.getvalue())) AssertionError: Failed doctest test for django.contrib.sessions.tests File "/Library/Python/2.5/site-packages/django/contrib/sessions/tests.py", line 0, in tests ---------------------------------------------------------------------- File "/Library/Python/2.5/site-packages/django/contrib/sessions/tests.py", line 140, in django.contrib.sessions.tests Failed example: cache_session.exists(cache_session.session_key) Expected: True Got: False
Attachments (1)
Change History (9)
comment:1 by , 16 years ago
comment:2 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 14 years ago
Has patch: | set |
---|---|
Patch needs improvement: | set |
Version: | 1.0 → SVN |
Hey guys, I took a crack at fixing this, you can see the patch / pull request here: https://github.com/django/django/pull/5
Obviously, my patch is suboptimal, maybe someone could take a look at it and make it more elegant?
I'd love to see this bug get squashed though, it is really annoying when running in development mode.
comment:4 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Bug |
comment:5 by , 13 years ago
Easy pickings: | unset |
---|---|
Patch needs improvement: | unset |
UI/UX: | unset |
Attached patch try to explicitely set the cache to LocMem instead of skipping the test when the dummy backend is setup.
comment:8 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Ran into this too. A solution might involve http://code.djangoproject.com/ticket/4788.