Django

Code

Show
Ignore:
Timestamp:
11/06/08 05:19:13 (2 months ago)
Author:
russellm
Message:

Fixed #9011 -- Corrected handling of fixture files that contain errors to correctly report the broken fixture name. Thanks to jlrivitti@gmail.com for the report and initial patch.

Files:

Legend:

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

    r8515 r9357  
    88    latin_name = models.CharField(max_length=150) 
    99    count = models.IntegerField() 
    10      
     10 
    1111    def __unicode__(self): 
    1212        return self.common_name 
     
    5757    title = models.CharField(max_length=255) 
    5858    channels = models.ManyToManyField(Channel) 
    59      
     59 
    6060    class Meta: 
    6161        ordering = ('id',) 
     
    114114No fixture data found for 'bad_fixture2'. (File format may be invalid.) 
    115115 
     116# Loading a fixture file with no data returns an error 
     117>>> management.call_command('loaddata', 'empty', verbosity=0) 
     118No fixture data found for 'empty'. (File format may be invalid.) 
     119 
     120# If any of the fixtures contain an error, loading is aborted 
     121# (Regression for #9011 - error message is correct) 
     122>>> management.call_command('loaddata', 'bad_fixture2', 'animal', verbosity=0) 
     123No fixture data found for 'bad_fixture2'. (File format may be invalid.) 
     124 
    116125>>> sys.stderr = savestderr 
    117126 
     
    124133 
    125134############################################### 
    126 # Test for ticket #7572 -- MySQL has a problem if the same connection is  
     135# Test for ticket #7572 -- MySQL has a problem if the same connection is 
    127136# used to create tables, load data, and then query over that data. 
    128137# To compensate, we close the connection after running loaddata.