more coverage stuff
This commit is contained in:
@@ -512,7 +512,7 @@ class gatewayresult():
|
||||
self.transaction = vtransaction()
|
||||
self.payment_method = vpayment_method()
|
||||
self.subscription = vsubscription()
|
||||
self.customer = customer()
|
||||
self.customer = kwargs.pop('customer',customer())
|
||||
|
||||
def __unicode__():
|
||||
return "mockedgatewayresult"
|
||||
@@ -526,12 +526,18 @@ class paypal_account():
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.subscriptions = [vsubscription(),vsubscription()]
|
||||
|
||||
class customercreateresult:
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.customer = kwargs.pop('customer',customer())
|
||||
self.is_success = kwargs.pop('is_success',True)
|
||||
self.customer_id = 1
|
||||
|
||||
class customer():
|
||||
def find(*arg, **kwargs):
|
||||
return self
|
||||
|
||||
def create(*args, **kwargs):
|
||||
return gatewayresult(is_success=True)
|
||||
return customercreateresult(is_success=True)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.credit_cards = [credit_card(),credit_card()]
|
||||
@@ -650,7 +656,6 @@ class MockBraintreeGateway:
|
||||
|
||||
|
||||
def mocked_gateway(*args, **kwargs):
|
||||
|
||||
return MockBraintreeGateway()
|
||||
|
||||
|
||||
@@ -912,6 +917,7 @@ def mocked_requests(*args, **kwargs):
|
||||
nktester = re.compile('.*?nkrowlink\.com')
|
||||
rp3tester = re.compile('.*?rp3rowing-app\.com')
|
||||
garmintester = re.compile('.*?garmin\.com')
|
||||
fakturoidtester = re.compile('.*?fakturoid\.cz')
|
||||
|
||||
c2importregex = '.*?concept2.com\/api\/users\/me\/results\/\d+'
|
||||
c2importtester = re.compile(c2importregex)
|
||||
@@ -1202,6 +1208,22 @@ def mocked_requests(*args, **kwargs):
|
||||
else:
|
||||
return MockResponse(c2workoutdata,200)
|
||||
|
||||
if fakturoidtester.match(args[0]):
|
||||
if 'invoices' in args[0]:
|
||||
response = {
|
||||
'url':'aap',
|
||||
'id':1,
|
||||
}
|
||||
return MockResponse(response,200)
|
||||
|
||||
response = [
|
||||
{
|
||||
'id':1,
|
||||
'url':'aap',
|
||||
}
|
||||
]
|
||||
return MockResponse(response,200)
|
||||
|
||||
return MockResponse(None,404)
|
||||
|
||||
class MockEmailMessage:
|
||||
|
||||
Reference in New Issue
Block a user