Skip to content

Commit

Permalink
Added standalone unit test runner. Fixed test_doDirectPayment_invalid…
Browse files Browse the repository at this point in the history
… logic.
  • Loading branch information
dcramer committed Jul 19, 2010
1 parent a8a5c36 commit 78da416
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion paypal/pro/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_doDirectPayment_invalid(self):
'creditcardtype': 'visa',
'ipaddress': '10.0.1.199',}
data.update(self.item)
self.assertRaises(PayPalFailure, self.wpp.doDirectPayment(data))
self.assertRaises(PayPalFailure, self.wpp.doDirectPayment, data)

def test_setExpressCheckout(self):
# We'll have to stub out tests for doExpressCheckoutPayment and friends
Expand Down
37 changes: 37 additions & 0 deletions runtests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env python
import sys
import getpass

from os.path import dirname, abspath

from django.conf import settings

if not settings.configured:
settings.configure(
DATABASE_ENGINE='sqlite3',
PAYPAL_RECEIVER_EMAIL='%s@localhost' % (getpass.getuser(),),
PAYPAL_TEST=True,
# Please dont make me create another test account and remove this from here :)
PAYPAL_WPP_USER='dcrame_1278645792_biz_api1.gmail.com',
PAYPAL_WPP_PASSWORD='1278645801',
PAYPAL_WPP_SIGNATURE='A4k1.O6xTyld5TiKeVmCuOgqzLRuAKuTtSG.7BD3R9E8SBa-J0pbUeYp',
INSTALLED_APPS=[
'paypal.pro',
'paypal.standard',
]
)

from django.test.simple import run_tests


def runtests(*test_args):
if not test_args:
test_args = ['pro', 'standard']
parent = dirname(abspath(__file__))
sys.path.insert(0, parent)
failures = run_tests(test_args, verbosity=1, interactive=True)
sys.exit(failures)


if __name__ == '__main__':
runtests(*sys.argv[1:])

0 comments on commit 78da416

Please sign in to comment.