def setUpTestData(cls):
     cls.belgian_ipa = StyleFactory(name="Belgian IPA")
     cls.english_cider = StyleFactory(name="English Cider")
     cls.farmhouse_ale = StyleFactory(name="foo")
     StyleAlternateNameFactory(style=cls.farmhouse_ale,
                               name="Farmhouse Ale - Other")
     cls.parser = UntappdParser()
 def setUpTestData(cls):
     super().setUpTestData()
     cls.venue = VenueFactory(tap_list_provider=ExampleTapListProvider.provider_name)
     VenueAPIConfiguration.objects.create(
         venue=cls.venue,
         url="https://localhost:8000",
     )
     ipa = StyleFactory(name="American IPA")
     StyleAlternateNameFactory(style=ipa, name="IPA - American")
     stout = StyleFactory(name="Sweet Stout")
     StyleAlternateNameFactory(style=stout, name="stout - milk")
 def test_beers(self):
     mfg = ManufacturerFactory()
     style = StyleFactory()
     beers = Beer.objects.bulk_create(
         BeerFactory.build(manufacturer=mfg, style=style) for _ in range(10)
     )
     taps = Tap.objects.bulk_create(
         Tap(
             beer=beer,
             tap_number=index + 1,
             venue=self.venue,
         )
         for index, beer in enumerate(beers)
     )
     response = self.client.get(f"{self.url}beers/")
     self.assertEqual(len(taps), len(beers))
     self.assertEqual(Beer.objects.count(), len(beers))
     self.assertEqual(response.status_code, 200, response.data)
     self.assertEqual(len(response.data["results"]), len(beers))
 def setUp(self):
     manufacturer = ManufacturerFactory()
     venue = VenueFactory()
     style = StyleFactory()
     self.beers = Beer.objects.bulk_create(
         BeerFactory.build(
             manufacturer=manufacturer,
             style=style,
         ) for _ in range(20))
     self.prices = BeerPrice.objects.bulk_create(
         BeerPrice(
             # pint
             serving_size_id=1,
             price=index * 2.1,
             beer=beer,
             venue=venue,
         ) for index, beer in enumerate(self.beers))
     self.taps = Tap.objects.bulk_create(
         # only for half of them
         TapFactory.build(beer=beer, venue=venue)
         for beer in self.beers[:10])
Exemple #5
0
 def test_style_strip_none(self):
     provider = BaseTapListProvider()
     style = StyleFactory(name='test style')
     looked_up = provider.get_style('None - TEST STYLE')
     self.assertEqual(looked_up, style)