Ejemplo n.º 1
0
 def test_downloads_to_csv_without_error(self):
     address = ShippingAddressFactory()
     create_order(shipping_address=address)
     page = self.get(reverse('dashboard:order-list'))
     form = page.forms['orders_form']
     form['selected_order'].checked = True
     form.submit('download_selected')
Ejemplo n.º 2
0
    def setUp(self):
        """
        Creates two orders. order_in has self.user in it's partner users list.
        """
        super().setUp()
        self.address = ShippingAddressFactory()
        self.basket_in = create_basket()
        self.basket_out = create_basket()
        # replace partner with one that has the user in it's users list
        self.partner_in = PartnerFactory(users=[self.user])
        stockrecord = self.basket_in.lines.all()[0].stockrecord
        stockrecord.partner = self.partner_in
        stockrecord.save()

        self.order_in = create_order(basket=self.basket_in,
                                     shipping_address=self.address)
        self.order_out = create_order(basket=self.basket_out,
                                      shipping_address=self.address)
Ejemplo n.º 3
0
 def test_titleless_salutation_is_stripped(self):
     a = ShippingAddressFactory(first_name='',
                                last_name='Barrington',
                                line1="75 Smith Road",
                                postcode="N4 8TY")
     self.assertEqual("Barrington", a.salutation)