Ejemplo n.º 1
0
    def test_invalid(self):
        data = copy(self.data)
        data['shipping_us_zip'] = ''     # no zip code
        form = OrderShippingAddressForm(data)
        self.assertFalse(form.is_valid())

        data2 = copy(self.data)
        data2['shipping_us_state'] = ''  # no state
        form2 = OrderShippingAddressForm(data2)
        self.assertFalse(form2.is_valid())
Ejemplo n.º 2
0
    def test_invalid(self):
        data = copy(self.data)
        data['shipping_state_province'] = ''
        form = OrderShippingAddressForm(data)
        self.assertFalse(form.is_valid())

        data2 = copy(self.data)
        data2['shipping_postal'] = ''
        form2 = OrderShippingAddressForm(data2)
        self.assertFalse(form2.is_valid())
Ejemplo n.º 3
0
 def test_valid(self):
     """
     Tests that the form correctly validates a US address
     """
     form = OrderShippingAddressForm(self.data)
     self.assertTrue(form.is_valid())