#13851: Clarification of the 'Fixture loading' section of the unit test
documentation
-------------------------------------------------------------------+--------
 Reporter:  igloo                                                  |       
Owner:  nobody    
   Status:  new                                                    |   
Milestone:            
Component:  Documentation                                          |     
Version:  1.2       
 Keywords:  fixtures, testing framework, unit tests, initial_data  |       
Stage:  Unreviewed
Has_patch:  0                                                      |  
-------------------------------------------------------------------+--------
 The documentation could do with elaborating on the loading of fixtures by
 the testing framework.

 Quoth the docs:

 "Once you've created a fixture and placed it in a fixtures directory in
 one of your INSTALLED_APPS, you can use it in your unit tests by
 specifying a fixtures  class attribute on your django.test.TestCase
 subclass:"

 [...]
 {{{
 class AnimalTestCase(TestCase):
     fixtures = ['mammals.json', 'birds']

 }}}

 What that says to me is, I can put any old file in the 'fixtures'
 directory and load it up in the test case by referring to it by filename,
 eg., 'mammals.json' - however, with the default behaviour, this isn't the
 case. The fixtures have to be in a file called 'initial_data'. I spent
 about 10 minutes tearing my hair out over this one!  I know it does
 mention  this in the box directly above the bit I've quoted, but is there
 any chance we can make it a bit clearer?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13851>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to