예제 #1
0
파일: check.py 프로젝트: rafrombrc/solitude
    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
예제 #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')
예제 #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")
예제 #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')
예제 #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
예제 #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()
예제 #7
0
 def test_no_seller(self):
     form = AccountCheck()
     assert not form.is_valid()
예제 #8
0
 def test_empty_token(self):
     form = AccountCheck({'seller': self.uuid})
     assert not form.is_valid()
예제 #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()
예제 #10
0
 def test_no_seller(self):
     form = AccountCheck()
     assert not form.is_valid()
예제 #11
0
 def test_empty_token(self):
     form = AccountCheck({'seller': self.uuid})
     assert not form.is_valid()