Django

Code

Changeset 6249

Show
Ignore:
Timestamp:
09/14/07 19:08:08 (1 year ago)
Author:
ikelly
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/regressiontests/fixtures_regress/models.py

    r5898 r6249  
    11from django.db import models 
    22from django.contrib.auth.models import User 
     3from django.conf import settings 
    34 
    45class Animal(models.Model): 
     
    2122     
    2223    def __unicode__(self): 
    23         return unicode(self.name) + u' is owned by ' + unicode(self.owner) 
     24        # Oracle doesn't distinguish between None and the empty string. 
     25        # This hack makes the test case pass using Oracle. 
     26        name = self.name 
     27        if settings.DATABASE_ENGINE == 'oracle' and name == u'': 
     28            name = None 
     29        return unicode(name) + u' is owned by ' + unicode(self.owner) 
    2430 
    2531__test__ = {'API_TESTS':"""