~ubuntu-branches/ubuntu/quantal/python-django/quantal-security

« back to all changes in this revision

Viewing changes to tests/modeltests/custom_pk/models.py

  • Committer: Bazaar Package Importer
  • Author(s): Chris Lamb
  • Date: 2010-05-21 07:52:55 UTC
  • mfrom: (1.3.6 upstream)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: james.westby@ubuntu.com-20100521075255-ii78v1dyfmyu3uzx
Tags: upstream-1.2
ImportĀ upstreamĀ versionĀ 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
"""
8
8
 
9
9
from django.conf import settings
10
 
from django.db import models, transaction, IntegrityError
 
10
from django.db import models, transaction, IntegrityError, DEFAULT_DB_ALIAS
11
11
 
12
12
from fields import MyAutoField
13
13
 
156
156
# SQLite lets objects be saved with an empty primary key, even though an
157
157
# integer is expected. So we can't check for an error being raised in that case
158
158
# for SQLite. Remove it from the suite for this next bit.
159
 
if settings.DATABASE_ENGINE != 'sqlite3':
 
159
if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'] != 'django.db.backends.sqlite3':
160
160
    __test__["API_TESTS"] += """
161
161
# The primary key must be specified, so an error is raised if you try to create
162
162
# an object without it.