Пример #1
0
 def handle(self, *args, **options):
     tap_list_provider = StemAndSteinParser()
     with transaction.atomic():
         for venue in tap_list_provider.get_venues():
             self.stdout.write("Processing %s" % venue.name)
             tap_list_provider.handle_venue(venue)
     self.stdout.write(self.style.SUCCESS("Done!"))
Пример #2
0
 def test_guess_manufacturer_back_forty(self):
     mfg = ManufacturerFactory(name="Back Forty")
     ManufacturerAlternateName.objects.bulk_create(
         ManufacturerAlternateName(name=name, manufacturer=mfg)
         for name in ["Back Forty", "Back Forty Beer Co"])
     parser = StemAndSteinParser()
     guessed = parser.guess_beer("Back Forty Truck Stop Honey Brown")
     self.assertEqual(guessed.manufacturer, mfg)
Пример #3
0
 def handle(self, *args, **options):
     if not BeerStyle.objects.exists():
         raise ValueError('You must import BJCP styles before continuing')
     tap_list_provider = StemAndSteinParser()
     with transaction.atomic():
         for venue in tap_list_provider.get_venues():
             self.stdout.write('Processing %s' % venue.name)
             tap_list_provider.handle_venue(venue)
     self.stdout.write(self.style.SUCCESS('Done!'))
Пример #4
0
 def test_guess_manufacturer_goat_island(self):
     mfg_names = [
         'Horny Goat Brewing Company', 'Goat Island Brewing', 'Goat Island',
     ]
     manufacturers = [
         ManufacturerFactory.build(name=name) for name in mfg_names
     ]
     Manufacturer.objects.bulk_create(manufacturers)
     parser = StemAndSteinParser()
     guessed = parser.guess_manufacturer('Goat Island Sipsey River Red Ale')
     self.assertEqual(guessed.name, 'Goat Island', guessed)
     self.assertIn(guessed, manufacturers)
Пример #5
0
 def test_guess_manufacturer_stone(self):
     mfg_names = [
         'New Realm Brewing Company / Stone', 'Stone Brewing ', 'Stone',
         'Stone Brewing Co.', 'Stone Brewing',
     ]
     manufacturers = [
         ManufacturerFactory.build(name=name) for name in mfg_names
     ]
     Manufacturer.objects.bulk_create(manufacturers)
     parser = StemAndSteinParser()
     guessed = parser.guess_manufacturer('Stone Enjoy By 04.20.19 IPA')
     self.assertEqual(guessed.name, 'Stone', guessed)
     self.assertIn(guessed, manufacturers)
Пример #6
0
 def test_guess_manufacturer_good_people(self):
     mfg_names = [
         'Goodwood', 'Good People Brewing Company', 'Good People',
         'Good People Brewing Co.',
     ]
     manufacturers = [
         ManufacturerFactory.build(name=name) for name in mfg_names
     ]
     Manufacturer.objects.bulk_create(manufacturers)
     parser = StemAndSteinParser()
     guessed = parser.guess_manufacturer('Good People IPA')
     self.assertEqual(guessed.name, 'Good People', guessed)
     self.assertIn(guessed, manufacturers)