Ejemplo n.º 1
0
def _subscription():
    zone = 'US/Pacific'
    preference_1 = SubscriptionDateTime(
        datetime=datetime(2017, 1, 20, 23, 0, tzinfo=utc))
    # Easier to think/verify in Pacific time since we are based in SF
    assert preference_1.datetime.astimezone(timezone(zone)).hour == 15
    preference_1.datetime = preference_1.datetime.replace(tzinfo=None)
    preference_1.put()

    preference_2 = SubscriptionDateTime(
        datetime=datetime(2017, 1, 20, 19, 0, tzinfo=utc))
    # Easier to think/verify in Pacific time since we are based in SF
    assert preference_2.datetime.astimezone(timezone(zone)).hour == 11
    preference_2.datetime = preference_2.datetime.replace(tzinfo=None)
    preference_2.put()

    rule = Rule(name='office', value='USA: CA SF New Montgomery Office').put()

    subscription = MeetingSubscription(
        title='Yelp Weekly',
        size=2,
        location='8th Floor',
        office='USA: CA SF New Montgomery Office',
        timezone=zone,
        datetime=[preference_1.key, preference_2.key],
        rules=[rule])
    subscription.put()
    return subscription
Ejemplo n.º 2
0
def _subscription():
    zone = 'America/Los_Angeles'
    preference_1 = SubscriptionDateTime(datetime=datetime(2017, 1, 20, 13, 0))
    preference_1.put()

    preference_2 = SubscriptionDateTime(datetime=datetime(2017, 1, 20, 11, 0))
    preference_2.put()

    rule = Rule(name='office', value='USA: CA SF New Montgomery Office').put()

    subscription = MeetingSubscription(
        title='Yelp Weekly',
        size=2,
        location='8th Floor',
        office='USA: CA SF New Montgomery Office',
        timezone=zone,
        datetime=[preference_1.key, preference_2.key],
        user_rules=[rule])
    subscription.put()
    return subscription