http://gavin/accounting/fraud_unit_test/
http://gavin/accounting/ajax/fraud_check/
http://gavin/accounting/ajax/fraud_check/?async=True
How to test on django shell:
from django.test.client import Client
from gavin.accounting.models import Order
client = Client()
response = client.post( '/accounting/fraud_unit_test/', {} )
fraud_data = { 'i': '8.8.8.8', 'city': 'Mountain View', 'region': 'CA', 'country': 'US', 'postal': '94043',
'domain': 'yahoo.com', 'license_key': '9edwkLEgHrWQ', 'email': 'alibaba@gmail.com', 'license_owner': 'Ali Baba',
'order_id': Order.objects.latest('counter').id, 'addresses': { 'invoice': { 'company': 'Google Inc', 'address1': '1600 Amphitheatre Parkway',
'zip': '94043', 'city': 'Mountain View', 'state': 'CA', 'vatid': 'FR1111133434' }, 'delivery': {} } }
from gavin.accounting.tasks import async_fraud_checker
res = async_fraud_checker.apply_async(args=[fraud_data, 'session162572t3'],
kwargs={'is_checked':True}, queue='celery', routing_key="celery")