brian-zhao / google-app-engine-django

Automatically exported from code.google.com/p/google-app-engine-django
Apache License 2.0
0 stars 0 forks source link

Sessions tests fail #181

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. svn checkout http://google-app-engine-django.googlecode.com/svn/trunk/ 
google-app-engine-django-test
2. cd google-app-engine-django-test
3. Symlink google_appengine to .google_appengine
4. Edit settings.py and uncomment 'django.contrib.sessions' in INSTALLED_APPS.
5. ./manage.py test sessions

What is the expected output? What do you see instead?
I expect the test to succeed, but it fails with this kind of errors:

File "/usr/lib/pymodules/python2.6/django/contrib/sessions/tests.py", line 53, 
in django.contrib.sessions.tests
Failed example:
    Session.objects.filter(pk=db_session.session_key).delete()
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/pymodules/python2.6/django/test/_doctest.py", line 1267, in __run
        compileflags, 1) in test.globs
      File "<doctest django.contrib.sessions.tests[33]>", line 1, in <module>
        Session.objects.filter(pk=db_session.session_key).delete()
    AttributeError: type object 'Session' has no attribute 'objects'

What version of the product are you using? On what operating system?
Ubuntu 10.04, python-django 1.1.1-2ubuntu1, google-app-engine-django r106, App 
Engine SDK 1.3.7, timestamp 1282688496.

Please provide any additional information below.
The error occurs because Django's tests are written with Django's models in 
mind, while google-app-engine-django uses Datastore models. However, the error 
also happens when I use the following settings:

    CACHE_BACKEND = 'memcached://'
    SESSION_ENGINE = 'django.contrib.sessions.backends.cache'

I'm not sure whether Django should just not test the Session model in 
django.contrib.sessions.tests and this is actually a Django bug, but it seems 
right to file it here first.

Original issue reported on code.google.com by sander.d...@gmail.com on 13 Sep 2010 at 7:39