示例#1
0
 def test_stripe_id_field_is_hidden(self):
     form = forms.MakePaymentForm()
     self.assertEqual(
         type(
             form.fields["stripe_id"].widget),
         django.forms.HiddenInput)
示例#2
0
 def test_expiry_year_field_required(self):
     form = forms.MakePaymentForm()
     self.assertTrue(form.fields['expiry_year'].required == False)
示例#3
0
    def test_expiry_year_field_choices(self):
        form = forms.MakePaymentForm()
        choices = form.fields["expiry_year"].choices

        for i in range(10):
            self.assertEqual(choices[i], (2020 + i, 2020 + i))
示例#4
0
    def test_expiry_month_field_choices(self):
        form = forms.MakePaymentForm()
        choices = form.fields["expiry_month"].choices

        for i in range(12):
            self.assertEqual(choices[i], (i + 1, i + 1))
示例#5
0
 def test_expiry_year_field__label(self):
     form = forms.MakePaymentForm()
     self.assertTrue(form.fields['expiry_year'].label == "Year")
示例#6
0
 def test_expiry_month_field_label(self):
     form = forms.MakePaymentForm()
     self.assertTrue(form.fields['expiry_month'].label == "Month")
示例#7
0
 def test_cvv_field_required(self):
     form = forms.MakePaymentForm()
     self.assertTrue(form.fields['cvv'].required == False)
示例#8
0
 def test_cvv_field_label(self):
     form = forms.MakePaymentForm()
     self.assertTrue(form.fields['cvv'].label == "Security code (CVV)")
示例#9
0
 def test_credit_card_number_field_required(self):
     form = forms.MakePaymentForm()
     self.assertTrue(form.fields['credit_card_number'].required == False)
示例#10
0
 def test_credit_card_number_field_label(self):
     form = forms.MakePaymentForm()
     self.assertTrue(
         form.fields['credit_card_number'].label == "Credit card number")