Skip to content

Commit

Permalink
Added a test for CreditCardField.
Browse files Browse the repository at this point in the history
  • Loading branch information
John Boxall committed May 28, 2009
1 parent 13959a8 commit a8c3678
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pro/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
from django.test.client import Client
from django.core.handlers.wsgi import WSGIRequest
from django.http import QueryDict
from django.forms import ValidationError

from paypal.pro.fields import CreditCardField
from paypal.pro.helpers import PayPalWPP


Expand Down Expand Up @@ -35,7 +37,15 @@ def request(self, **request):
# Fake PayPal responses
# self.responses = {
# "DoDirectPayment": "Dodirect pay!!!",}



class CreditCardFieldTest(TestCase):
def testCreditCardField(self):
field = CreditCardField()
field.clean('4797503429879309')
self.assertEquals(field.card_type, "Visa")
self.assertRaises(ValidationError, CreditCardField().clean, '1234567890123455')


class PayPalWPPTestCase(TestCase):
def setUp(self):
Expand Down

0 comments on commit a8c3678

Please sign in to comment.