Selenium / Django gives Foreign Key error Selenium / Django gives Foreign Key error selenium selenium

Selenium / Django gives Foreign Key error


As I mentioned in the comments, this seems to be a documented bug in Django. Here and here are the official bug reports. As reported in the second link, one workaround is to swap the order of django.contrib.auth and django.contrib.contenttypes in INSTALLED_APPS, as such:

What originally is this:

INSTALLED_APPS = (    'django.contrib.auth',    'django.contrib.contenttypes',    'django.contrib.sessions',    'django.contrib.sites',    'django.contrib.admin',    'testapp')

Should become:

INSTALLED_APPS = (    'django.contrib.contenttypes',    'django.contrib.auth',    'django.contrib.sessions',    'django.contrib.sites',    'django.contrib.admin',    'testapp')