When I run the unit tests, I get a failure (stack trace below) from django.contrib.auth.tests.views.LoginTest. test_current_site_in_context_after_login calls Site.objects.get_current() which fails because I'm not using that app. If I include it in the list of installed apps, then the test passes. However, then a bunch of the tests that I've written fail; I think that's because they are using fixtures that are not valid with respect to the schema defined the inclusion of sites, but I haven't confirmed this.
Is the test broken or is there something that I'm doing that makes the sites app mandatory?
ERROR: test_current_site_in_context_after_login (django.contrib.auth.tests.views.LoginTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/views.py", line 182, in test_current_site_in_context_after_login
site = Site.objects.get_current()
File "/usr/lib/pymodules/python2.6/django/contrib/sites/models.py", line 22, in get_current
current_site = self.get(pk=sid)
File "/usr/lib/pymodules/python2.6/django/db/models/manager.py", line 132, in get
return self.get_query_set().get(*args, **kwargs)
File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line 336, in get
num = len(clone)
File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line 81, in __len__
self._result_cache = list(self.iterator())
File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line 269, in iterator
for row in compiler.results_iter():
File "/usr/lib/pymodules/python2.6/django/db/models/sql/compiler.py", line 672, in results_iter
for rows in self.execute_sql(MULTI):
File "/usr/lib/pymodules/python2.6/django/db/models/sql/compiler.py", line 727, in execute_sql
cursor.execute(sql, params)
File "/usr/lib/pymodules/python2.6/django/db/backends/sqlite3/base.py", line 200, in execute
return Database.Cursor.execute(self, query, params)
DatabaseError: no such table: django_site