Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made the fixtures_regress test case be aware of Oracle's empty string

limitations.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6249 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit ad821b645968d905556b5d7811acec4af754a62b 1 parent 8c5214d
@ikelly ikelly authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 tests/regressiontests/fixtures_regress/models.py
View
8 tests/regressiontests/fixtures_regress/models.py
@@ -1,5 +1,6 @@
from django.db import models
from django.contrib.auth.models import User
+from django.conf import settings
class Animal(models.Model):
name = models.CharField(max_length=150)
@@ -20,7 +21,12 @@ class Stuff(models.Model):
owner = models.ForeignKey(User, null=True)
def __unicode__(self):
- return unicode(self.name) + u' is owned by ' + unicode(self.owner)
+ # Oracle doesn't distinguish between None and the empty string.
+ # This hack makes the test case pass using Oracle.
+ name = self.name
+ if settings.DATABASE_ENGINE == 'oracle' and name == u'':
+ name = None
+ return unicode(name) + u' is owned by ' + unicode(self.owner)
__test__ = {'API_TESTS':"""
>>> from django.core import management
Please sign in to comment.
Something went wrong with that request. Please try again.