Esempio n. 1
0
    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
Esempio n. 2
0
    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')
Esempio n. 3
0
    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")
Esempio n. 4
0
    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')
Esempio n. 5
0
    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
Esempio n. 6
0
    def test_empty_paypal_id(self):
        self.paypal.token = 'token'
        self.paypal.save()

        form = AccountCheck({'seller': self.uuid})
        assert not form.is_valid()
Esempio n. 7
0
 def test_no_seller(self):
     form = AccountCheck()
     assert not form.is_valid()
Esempio n. 8
0
 def test_empty_token(self):
     form = AccountCheck({'seller': self.uuid})
     assert not form.is_valid()
Esempio n. 9
0
    def test_empty_paypal_id(self):
        self.paypal.token = 'token'
        self.paypal.save()

        form = AccountCheck({'seller': self.uuid})
        assert not form.is_valid()
Esempio n. 10
0
 def test_no_seller(self):
     form = AccountCheck()
     assert not form.is_valid()
Esempio n. 11
0
 def test_empty_token(self):
     form = AccountCheck({'seller': self.uuid})
     assert not form.is_valid()