def setUpClass(cls): """Set up class.""" # Books cls.books = [] cls.books.append( factories.BookFactory( title='Ccccc Bbbb', summary='`Twas brillig, and the slithy toves ' 'Did gyre and gimble in the wabe. ' 'All mimsy were the borogoves ' 'And the mome raths outgrabe.', publisher__name='Antares', publisher__country='Armenia', )) cls.books.append( factories.BookFactory( title='Ccccc Cccc', summary='"Beware the Jabberwock, my son! ' 'The jaws that bite, the claws that catch! ' 'Beware the Jubjub bird, and shun ' 'The frumious Bandersnatch!', publisher__name='Antares', publisher__country='Armenia', )) cls.books.append( factories.BookFactory( title='Ccccc Dddd', summary='He took his vorpal sword in his hand,' 'Long time the manxome foe he sought --' 'So rested he by the Tumtum tree,' 'And stood awhile in thought.', publisher__name='Antares', publisher__country='Armenia', )) cls.books.append( factories.BookFactory( title='Ccccc Eeee', summary='She took his zorpal blade in his hand,' 'Long time the manxome foe he sought --' 'So rested he by the Tumtum tree,' 'And stood awhile in thought.', # publisher__name='Mario', # publisher__country='US', )) cls.books += factories.BookFactory.create_batch( 10, publisher__name='Oxford University Press', publisher__city='Yerevan', publisher__state_province='Ararat', publisher__country='Ireland', ) cls.books_suggest_context_url = reverse( 'bookdocument_frontend-suggest', kwargs={}) # Addresses cls.addresses = [] cls.addresses.append( factories.AddressFactory( street='Halabyan', city__name='Yerevan', latitude=40.0742719, longitude=44.1930605, )) cls.addresses.append( factories.AddressFactory( street='Hambardzumyan', city__name='Yerevan', latitude=40.01, longitude=44.01, )) cls.addresses.append( factories.AddressFactory( street='Haghartsin', city__name='Yerevan', latitude=39.92, longitude=43.92, )) cls.addresses.append( factories.AddressFactory( street='Hamazaspyan', city__name='Tatev', latitude=39.3793612, longitude=46.2480006, )) cls.addresses.append( factories.AddressFactory( street='Harazatyan', city__name='Tatev', latitude=39.3793612, longitude=46.2480006, )) cls.addresses.append( factories.AddressFactory( street='Hardewijk', city__name='Groningen', latitude=53.2246892, longitude=6.56429, )) cls.addresses.append( factories.AddressFactory( street='Haringstraat', city__name='Groningen', latitude=53.2246892, longitude=6.56429, )) cls.addresses_suggest_context_url = reverse( 'addressdocument_frontend-suggest', kwargs={}) call_command('search_index', '--rebuild', '-f')
def setUpClass(cls): """Set up class.""" cls.publishers = [] cls.publishers.append( factories.PublisherFactory( name='Addison–Wesley', city='Brighton & Hove', state_province='East Midlands', country='Armenia', )) cls.publishers.append( factories.PublisherFactory( name='Adis International', city='Bristol', state_province='East of England', country='Argentina', )) cls.publishers.append( factories.PublisherFactory( name='Atlantic Books', city='Cardiff', state_province='North East', country='Belgium', )) cls.publishers.append( factories.PublisherFactory( name='Atlas Press', city='Carlisle', state_province='North West', country='Belarus', )) cls.publishers.append( factories.PublisherFactory( name='Book League of America', city='Chelmsford', state_province='South East', country='Burkina Faso', )) cls.publishers.append( factories.PublisherFactory( name='Book Works', city='Chester', state_province='South West', country='Burundi', )) cls.publishers.append( factories.PublisherFactory( name='Booktrope', city='Chichester', state_province='West Midlands', country='Netherlands', )) cls.publishers_url = reverse('publisherdocument-suggest', kwargs={}) cls.books = [] cls.books.append( factories.BookFactory( title='Aaaaa Bbbb', summary='`Twas brillig, and the slithy toves ' 'Did gyre and gimble in the wabe. ' 'All mimsy were the borogoves ' 'And the mome raths outgrabe.', publisher__name='Antares', publisher__country='Armenia', )) cls.books.append( factories.BookFactory( title='Aaaaa Cccc', summary='"Beware the Jabberwock, my son! ' 'The jaws that bite, the claws that catch! ' 'Beware the Jubjub bird, and shun ' 'The frumious Bandersnatch!', publisher__name='Antares', publisher__country='Armenia', )) cls.books.append( factories.BookFactory( title='Aaaaa Dddd', summary='He took his vorpal sword in his hand,' 'Long time the manxome foe he sought --' 'So rested he by the Tumtum tree,' 'And stood awhile in thought.', publisher__name='Antares', publisher__country='Armenia', )) cls.books += factories.BookFactory.create_batch( 10, publisher__name='Oxford University Press', publisher__city='Yerevan', publisher__state_province='Ararat', publisher__country='Ireland', ) cls.books_url = reverse('bookdocument-suggest', kwargs={}) cls.authors = [] cls.authors.append( factories.AuthorFactory( name='John Doe', salutation='Aaa Bbb', )) cls.authors.append( factories.AuthorFactory( name='Jane Doe', salutation='Aaa Ccc', )) cls.authors.append( factories.AuthorFactory( name='Armen Doe', salutation='Bbb Ccc', )) cls.authors_url = reverse('authordocument-suggest', kwargs={}) cls.created_addresses() call_command('search_index', '--rebuild', '-f')
def setUp(self): self.book = factories.BookFactory(**BOOK_DATA)