Пример #1
0
def new_subscription():
    subscription = UserSubscription()
    subscription.subscription_type_id = '1'
    subscription.start_date = datetime.datetime.strptime(
        '2020-7-1 00:00:00', '%Y-%m-%d %H:%M:%S')
    subscription.end_date = datetime.datetime.strptime('2020-8-1 00:00:00',
                                                       '%Y-%m-%d %H:%M:%S')
    return subscription
Пример #2
0
     'REFRESH_TOKEN', '86a42f98ad7a1703e7619d7c1abace0fd43288af')
 IMGUR_ACCOUNT_ID = ConfigValues('IMGUR_ACCOUNT_ID', '127525815')
 IMGUR_ACCOUNT_USERNAME = ConfigValues('IMGUR_ACCOUNT_USERNAME',
                                       'adayahouse')
 STRIPE_PUBLISHABLE_KEY = ConfigValues('STRIPE_PK', '')
 STRIPE_S_KEY = ConfigValues('STRIPE_SK', '')
 subtype = SubscriptionType(plan='Adaya Lite', price=10)
 subtype2 = SubscriptionType(plan='Adaya Lifestyle', price=40)
 subtype.stripe_subscription_product = 'prod_HKKYExqtgZlZ0R'
 subtype.stripe_price = 'price_HKKb1y8VgSax36'
 subtype2.stripe_subscription_product = 'prod_HKKboFqONk8aba'
 subtype2.stripe_price = 'price_HKKcUelIoiOo5m'
 usersubscription = UserSubscription()
 usersubscription.user_id = 2
 usersubscription.start_date = datetime.now()
 usersubscription.end_date = datetime.strptime('06-02-2020 05:58:00',
                                               '%d-%m-%Y %H:%M:%S')
 usersubscription.subscription_type = subtype
 food_category = ProductCategory('food')
 clothes_category = ProductCategory('cloth')
 food_article = ArticleCategory('food-article')
 clothes_article = ArticleCategory('cloth-article')
 status = ArticleStatus('draft')
 order_status = OrderStatus('completed')
 db.session.add(order_status)
 db.session.add(food_article)
 db.session.add(clothes_article)
 db.session.add(food_category)
 db.session.add(clothes_category)
 for x in range(10):
     product = Product(randomString(10))
     product.image = 'https://i.imgur.com/xyAZ6sF.jpg,https://i.imgur.com/TcT4srW.jpg,https://i.imgur.com/79QF80y.jpg,https://i.imgur.com/CIAcwiV.jpg'