Esempio n. 1
0
 def test_add_order_view(self):
     with app.test_request_context():
         event, ticket = get_event_ticket()
         response = self.app.get(url_for('event_ticket_sales.add_order',
                                         event_id=event.id),
                                 follow_redirects=True)
         self.assertTrue(str(ticket.name) in response.data,
                         msg=response.data)
def create_order(self):
    event, ticket = get_event_ticket()
    data = {
        "event_id": event.id,
        "ticket_ids[]": [ticket.id],
        "ticket_quantities[]": [5],
        "ticket_subtotals[]": [str(ticket.price * 5)],
        "payment_via": "stripe"
    }
    response = self.app.post(url_for('event_ticket_sales.add_order', event_id=event.id),
                             data=data, follow_redirects=True)
    self.assertTrue(str(ticket.price * 5) in response.data, msg=response.data)
    soup = BeautifulSoup(response.data, 'html.parser')
    identifier = soup.select_one('input[name="identifier"]').get('value')
    return event, ticket, identifier
Esempio n. 3
0
def create_order(self):
    event, ticket = get_event_ticket()
    data = {
        "event_id": event.id,
        "ticket_ids[]": [ticket.id],
        "ticket_quantities[]": [5],
        "ticket_subtotals[]": [str(ticket.price * 5)],
        "payment_via": "stripe"
    }
    response = self.app.post(url_for('event_ticket_sales.add_order',
                                     event_id=event.id),
                             data=data,
                             follow_redirects=True)
    self.assertTrue(str(ticket.price * 5) in response.data, msg=response.data)
    soup = BeautifulSoup(response.data, 'html.parser')
    identifier = soup.select_one('input[name="identifier"]').get('value')
    return event, ticket, identifier
 def test_add_order_view(self):
     with app.test_request_context():
         event, ticket = get_event_ticket()
         response = self.app.get(url_for('event_ticket_sales.add_order', event_id=event.id), follow_redirects=True)
         self.assertTrue(str(ticket.name) in response.data, msg=response.data)