From bb99fe46b7915ef131ba54e8348c9a1d52bd6ddd Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Thu, 25 Aug 2011 09:23:49 +0000 Subject: [PATCH] Fix test from r16678 and r16681 properly for Oracle. Fixes #16694, with thanks to aagustin for the Oracle testing and tweaking. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16686 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/modeltests/invalid_models/invalid_models/models.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/modeltests/invalid_models/invalid_models/models.py b/tests/modeltests/invalid_models/invalid_models/models.py index e549478496..d45b28cd0b 100644 --- a/tests/modeltests/invalid_models/invalid_models/models.py +++ b/tests/modeltests/invalid_models/invalid_models/models.py @@ -5,7 +5,7 @@ This example exists purely to point out errors in models. """ -from django.db import models +from django.db import connection, models class FieldErrors(models.Model): charfield = models.CharField() @@ -342,5 +342,8 @@ invalid_models.nonuniquefktarget2: Field 'bad' under model 'FKTarget' must have invalid_models.nonexistingorderingwithsingleunderscore: "ordering" refers to "does_not_exist", a field that doesn't exist. invalid_models.invalidsetnull: 'fk' specifies on_delete=SET_NULL, but cannot be null. invalid_models.invalidsetdefault: 'fk' specifies on_delete=SET_DEFAULT, but has no default value. -invalid_models.primarykeynull: "my_pk_field": Primary key fields cannot have null=True. +""" + +if not connection.features.interprets_empty_strings_as_nulls: + model_errors += """invalid_models.primarykeynull: "my_pk_field": Primary key fields cannot have null=True. """