Test-Driven Development with Django by 2015

Test-Driven Development with Django by 2015

Author:2015
Language: eng
Format: epub, mobi
Publisher: Packt Publishing


Okay, we'll need more models for this. Let's add them to SoloModelTestCase.setUp, and update the Solo object with what we want the hierarchy to be. Add a couple of imports and the following lines to the setUp method in solos/tests/test_models.py:

from albums.models import Album, Track ... def setUp(self): self.album = Album.objects.create( name='At the Stratford Shakespearean Festival', artist='Oscar Peterson Trio', slug='at-the-stratford-shakespearean-festival' ) self.track = Track.objects.create( name='Falling in Love with Love', album=self.album, track_number=1, slug='falling-in-love-with-love' ) self.solo = Solo.objects.create( track=self.track, artist='Oscar Peterson', instrument='piano', start_time='1:24', end_time='4:06', slug='oscar-peterson' )



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.