Esempio n. 1
0
 def startTest(self, test):
     """
     When preparing the database, check for the `poseur_fixtures`
     attribute and load those.
     """
     test_case = get_test_case_class(test)
     fixtures = getattr(test_case, "poseur_fixtures", [])
     for fixture in fixtures:
         load_fixtures(fixture)
Esempio n. 2
0
def setupModule():
    try:
        load_fixtures('tiger.fixtures')
    except IntegrityError:
        transaction.rollback()
    site = Site.objects.all()[0]
    sms = site.sms
    sms.sms_number = faker.phone_number.phone_number()[:20]
    sms.send_intro = False
    sms.reseller_network = False
    sms.save()
    site.reseller_network = False
    site.save()
    account_settings = site.account.sms
    account_settings.intro_sms = 'Free burger!'
    account_settings.save()
Esempio n. 3
0
def setupModule():
    try:
        load_fixtures('tiger.fixtures')
    except IntegrityError:
        transaction.rollback()
    site = Site.objects.all()[0]
    sms = site.sms
    sms.sms_number = faker.phone_number.phone_number()[:20]
    sms.send_intro = False
    sms.reseller_network = False
    sms.save()
    site.reseller_network = False
    site.save()
    account_settings = site.account.sms
    account_settings.intro_sms = 'Free burger!'
    account_settings.save()
 def _setup():
     if not Site.objects.count():
         load_fixtures('tiger.fixtures')
     site = Site.objects.all()[0]
     site.plan, created = Plan.objects.get_or_create(has_online_ordering=True)
     site.save()
     location, = site.location_set.all()
     location.eod_buffer = 15
     location.tax_rate = '6.25'
     site.enable_orders = True
     site.save()
     schedule = location.schedule
     if schedule is None:
         schedule = location.schedule = Schedule.objects.create(site=site)
     location.save()
     create_timeslots(schedule, dt, 30, 30)
Esempio n. 5
0
 def _setup():
     if not Site.objects.count():
         load_fixtures('tiger.fixtures')
     site = Site.objects.all()[0]
     site.plan, created = Plan.objects.get_or_create(
         has_online_ordering=True)
     site.save()
     location, = site.location_set.all()
     location.eod_buffer = 15
     location.tax_rate = '6.25'
     site.enable_orders = True
     site.save()
     schedule = location.schedule
     if schedule is None:
         schedule = location.schedule = Schedule.objects.create(site=site)
     location.save()
     create_timeslots(schedule, dt, 30, 30)
Esempio n. 6
0
def setup_schedule_with_gaps():
    if not Site.objects.count():
        load_fixtures('tiger.fixtures')
    site = Site.objects.all()[0]
    site.plan, created = Plan.objects.get_or_create(has_online_ordering=True)
    site.save()
    location, = site.location_set.all()
    location.eod_buffer = 0
    location.tax_rate = '6.25'
    site.enable_orders = True
    site.save()
    schedule = location.schedule
    if schedule is None:
        schedule = location.schedule = Schedule.objects.create(site=site)
    location.save()
    for day in (0, 2, 4):  # Mon, Wed, Fri
        TimeSlot.objects.create(dow=day,
                                schedule=schedule,
                                start=(datetime(2011, 7, 17, 9, 0)).time(),
                                stop=(datetime(2011, 7, 17, 17, 0)).time())
def setup_schedule_with_gaps():
    if not Site.objects.count():
        load_fixtures('tiger.fixtures')
    site = Site.objects.all()[0]
    site.plan, created = Plan.objects.get_or_create(has_online_ordering=True)
    site.save()
    location, = site.location_set.all()
    location.eod_buffer = 0
    location.tax_rate = '6.25'
    site.enable_orders = True
    site.save()
    schedule = location.schedule
    if schedule is None:
        schedule = location.schedule = Schedule.objects.create(site=site)
    location.save()
    for day in (0, 2, 4): # Mon, Wed, Fri
        TimeSlot.objects.create(
            dow=day, schedule=schedule,
            start=(datetime(2011, 7, 17, 9, 0)).time(),
            stop=(datetime(2011, 7, 17, 17, 0)).time()
        )
Esempio n. 8
0
def run_fixtures():
    if not Site.objects.count():
        load_fixtures('tiger.fixtures')
        call_command('loaddata', 'stork/fixtures/initial_data.json')
Esempio n. 9
0
 def setup_class(cls):
     if hasattr(cls, 'poseur_fixtures'):
         call_command('flush', verbosity=0, interactive=False, database='default')
         load_fixtures(cls.poseur_fixtures)
Esempio n. 10
0
 def setUp(self):
     if not Site.objects.count():
         load_fixtures('tiger.fixtures')
     self.client = Client(HTTP_HOST='foo.takeouttiger.com')
     self.site = Site.objects.all()[0]