def obj_create(self, bundle, request, **kwargs): form = AccountCheck(bundle.data) if not form.is_valid(): raise self.form_errors(form) check = Check(**form.kwargs()) check.all() bundle.data = {"passed": check.passed, "errors": check.errors} return bundle
def test_good(self): self.paypal.paypal_id = 'asd' self.paypal.token = 'token' self.paypal.save() form = AccountCheck({'seller': self.uuid}) assert form.is_valid() eq_(form.cleaned_data['paypal_id'], 'asd') eq_(form.cleaned_data['token'], 'token')
def test_good(self): self.paypal.paypal_id = "asd" self.paypal.token = "token" self.paypal.save() form = AccountCheck({"seller": self.uuid}) assert form.is_valid() eq_(form.cleaned_data["paypal_id"], "asd") eq_(form.cleaned_data["token"], "token")
def obj_create(self, bundle, request, **kwargs): form = AccountCheck(bundle.data) if not form.is_valid(): raise self.form_errors(form) check = Check(**form.kwargs()) check.all() bundle.data = {'passed': check.passed, 'errors': check.errors} return bundle
def test_empty_paypal_id(self): self.paypal.token = 'token' self.paypal.save() form = AccountCheck({'seller': self.uuid}) assert not form.is_valid()
def test_no_seller(self): form = AccountCheck() assert not form.is_valid()
def test_empty_token(self): form = AccountCheck({'seller': self.uuid}) assert not form.is_valid()