0

I recently upgraded my django framework from 1.3 to 1.4. Today I ran some tests on the login page. I have a switch which determines whether a 'reset password' link should be displayed on the login screen. This test worked nicely under 1.3, but doesn't under 1.4.

I've setup my own view and template for the login page as follows:

urlpatterns = patterns('framework.views',
    url(r'^$', 'index'),
    url(r'^login/$', 'login_view'),
    url(r'^logout/$', 'logout_view'),
...

Upon some further investigation I noticed that if I browse to the login page the first time, it works. If I then remove the entries from my urls.py file (ie the /login/ entries), I can still browse to the /login/ page. Even when I restart the django test server, that url entry is still valid. Even deleting the urls.pyc file doesn't give me a 404. Its only when I try and post, that I'll get a 404. Incidentally, this phenomenon doesn't happen for some of my other urls.

I have a feeling the reason why my tests fail is that django somehow caches the /login/ request in some mysterious way and so the login page never refreshes for each of the tests I run on the screen. Does anybody know how to overcome this problem and perhaps also why it is that this particular feature has changed. Does it have anything to do with the newly implemented template response??

Gevious
  • 3,214
  • 3
  • 21
  • 42

1 Answers1

2

Do you use firefox? Try to remove Firefox cache, or whatever browser's cache you are using...

I ran into the same issue yesterday. I look around and i found a lot of people having this issue. Have a look at this...

Don't blame django as i did in first place ;) (i blamed me later, before knowing the real problem)...

Let's blame the protocol :P

Hope this solves your problem!

EDIT: Here you have some possible solutions to your problem (if you use firefox):

1) http://support.mozilla.org/es/questions/848678

2) https://superuser.com/questions/23134/how-to-turn-off-firefox-cache

Community
  • 1
  • 1
marianobianchi
  • 8,238
  • 1
  • 20
  • 24
  • I fell for the oldest trick in the book. Turns out I had installed memcache on my local machine to test some unrelated caching problem which I solved. When running the tests, memcached was caching the views and so causing the errors. – Gevious Jun 06 '12 at 07:52