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