Exemplo 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
Exemplo 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')
Exemplo 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")
Exemplo 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')
Exemplo 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
Exemplo 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()
Exemplo n.º 7
0
 def test_no_seller(self):
     form = AccountCheck()
     assert not form.is_valid()
Exemplo n.º 8
0
 def test_empty_token(self):
     form = AccountCheck({'seller': self.uuid})
     assert not form.is_valid()
Exemplo 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()
Exemplo n.º 10
0
 def test_no_seller(self):
     form = AccountCheck()
     assert not form.is_valid()
Exemplo n.º 11
0
 def test_empty_token(self):
     form = AccountCheck({'seller': self.uuid})
     assert not form.is_valid()