Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)

src/d/j/django-oscar-HEAD/tests/unit/payment/form_tests.py   django-oscar(Download)
    def setUp(self):
        self.field = forms.BankcardNumberField()
 
    def test_strips_non_digits(self):
        self.assertEqual(
    def test_amex_accepted_when_allowed(self):
        # Number taken from http://www.darkcoding.net/credit-card-numbers/
        self.field = forms.BankcardNumberField(types=['American Express',])
        self.assertEqual(
            '348934265521923', self.field.clean('348934265521923'))
 
    def test_amex_rejected_when_disallowed(self):
        self.field = forms.BankcardNumberField(types=['Visa',])
    def test_raises_error_for_invalid_card_type(self):
        with self.assertRaises(ImproperlyConfigured):
            self.field = forms.BankcardNumberField(types=['American Express', 'Nonsense'])