def create_order(self, party_id, user, order_number): order = create_order(party_id, user, order_number=order_number) self.db.session.add(order) self.db.session.commit() return order.to_tuple()
def create_order(self, quantified_articles): order = create_order(self.party.id, self.orderer) self.db.session.add(order) for article, quantity_to_order in quantified_articles: order_item = create_order_item(order, article, quantity_to_order) self.db.session.add(order_item) return order
def create_order_with_payment_state(payment_state): user = create_user() shop_id = 'shop-123' placed_by = user order = create_order(shop_id, placed_by) order.payment_state = payment_state return order
def create_order_with_payment_state(payment_state): user = create_user(42) party_id = 'acme-party-2016' placed_by = user order = create_order(party_id, placed_by) order.payment_state = payment_state return order
def create_order(self, quantified_articles): order = create_order(self.party.id, self.orderer) self.db.session.add(order) for article, quantity_to_order in quantified_articles: order_item = create_order_item(order, article, quantity_to_order) self.db.session.add(order_item) self.db.session.commit() return order
def create_order_with_items(price_quantity_pairs): user = create_user(42) party_id = 'acme-party-2016' placed_by = user order = create_order(party_id, placed_by) for price, quantity in price_quantity_pairs: article = create_article(price=price, quantity=quantity) order_item = create_order_item(order, article, quantity) return order
def create_order_with_items(price_quantity_pairs): user = create_user() party_id = 'acme-party-2016' placed_by = user order = create_order(party_id, placed_by) for price, quantity in price_quantity_pairs: article = create_article(price=price, quantity=quantity) order_item = create_order_item(order, article, quantity) return order
def create_order(self): orderer = self.build_orderer() self.db.session.add(orderer) self.order = create_order(self.party.id, orderer, order_number='LR-08-B00027') self.order.created_at = datetime(2015, 2, 26, 13, 26, 24) self.db.session.add(self.order) order_items = self.build_order_items() self.db.session.add_all(order_items) self.db.session.commit()
def create_order(self, order_number, article_quantity, payment_state): order = create_order(self.party.id, self.user, order_number=order_number) order.payment_state = payment_state self.db.session.add(order) order_item = create_order_item(order, self.article, article_quantity) self.db.session.add(order_item) self.db.session.commit() return order.to_tuple()