Esempio n. 1
0
 def test_verify(self):
     url = absolutify(reverse('receipt.test.verify',
                              kwargs={'status': 'expired'}))
     receipt = create_test_receipt('http://foo', 'expired')
     req = RawRequestFactory().post(url, receipt)
     res = devhub_verify(req, 'expired')
     eq_(json.loads(res.content)['status'], 'expired')
Esempio n. 2
0
 def test_verify(self):
     url = absolutify(
         reverse('receipt.test.verify', kwargs={'status': 'expired'}))
     receipt = create_test_receipt('http://foo', 'expired')
     req = RawRequestFactory().post(url, receipt)
     res = devhub_verify(req, 'expired')
     eq_(json.loads(res.content)['status'], 'expired')
Esempio n. 3
0
 def test_verify(self):
     receipt = create_test_receipt('http://foo', 'expired')
     res = self.client.post(reverse('receipt.test.verify',
                                    args=['expired']),
                            receipt,
                            content_type='text/plain')
     eq_(json.loads(res.content)['status'], 'expired')
Esempio n. 4
0
 def obj_create(self, bundle, request=None, **kwargs):
     receipt_cef.log(request, None, 'sign', 'Test receipt signing')
     bundle.data = {
         'receipt':
         create_test_receipt(bundle.data['root'],
                             bundle.data['receipt_type'])
     }
     return bundle
Esempio n. 5
0
def test_receipt(request):
    form = forms.TestInstall(request.DATA)
    if not form.is_valid():
        return Response({"error_message": form.errors}, status=400)

    receipt_cef.log(request._request, None, "sign", "Test receipt signing")
    data = {"receipt": create_test_receipt(form.cleaned_data["root"], form.cleaned_data["receipt_type"])}
    return Response(data, status=201)
Esempio n. 6
0
def test_receipt(request):
    form = forms.TestInstall(request.DATA)
    if not form.is_valid():
        return Response({'error_message': form.errors}, status=400)

    receipt_cef.log(request._request, None, 'sign', 'Test receipt signing')
    data = {
        'receipt': create_test_receipt(form.cleaned_data['root'],
                                       form.cleaned_data['receipt_type'])
    }
    return Response(data, status=201)
Esempio n. 7
0
def test_receipt(request):
    form = TestInstall(request.DATA)
    if not form.is_valid():
        return Response({'error_message': form.errors}, status=400)

    receipt_cef.log(request._request, None, 'sign', 'Test receipt signing')
    data = {
        'receipt': create_test_receipt(form.cleaned_data['root'],
                                       form.cleaned_data['receipt_type'])
    }
    return Response(data, status=201)
Esempio n. 8
0
def devhub_receipt(request):
    form = forms.TestInstall(request.POST)
    if form.is_valid():
        data = form.cleaned_data

        if data["receipt_type"] == "none":
            return {"receipt": "", "error": ""}

        receipt_cef.log(request, None, "sign", "Test receipt signing")
        receipt = create_test_receipt(data["root"], data["receipt_type"])
        return {"receipt": receipt, "error": ""}

    return {"receipt": "", "error": form.errors}
Esempio n. 9
0
def test_receipt(request):
    form = forms.TestInstall(request.POST)
    if form.is_valid():
        receipt_type = form.cleaned_data['receipt_type']

        if receipt_type == 'none':
            return {'receipt': '', 'error': ''}

        receipt_cef.log(request, None, 'sign', 'Test receipt signing')
        receipt = create_test_receipt(form.root, receipt_type)
        return {'receipt': receipt, 'error': ''}

    return {'receipt': '', 'error': form.errors}
Esempio n. 10
0
def test_receipt(request):
    form = forms.TestInstall(request.POST)
    if form.is_valid():
        receipt_type = form.cleaned_data['receipt_type']

        if receipt_type == 'none':
            return {'receipt': '', 'error': ''}

        receipt_cef.log(request, None, 'sign', 'Test receipt signing')
        receipt = create_test_receipt(form.root, receipt_type)
        return {'receipt': receipt, 'error': ''}

    return {'receipt': '', 'error': form.errors}
Esempio n. 11
0
def devhub_receipt(request):
    form = forms.TestInstall(request.POST)
    if form.is_valid():
        data = form.cleaned_data

        if data['receipt_type'] == 'none':
            return {'receipt': '', 'error': ''}

        receipt_cef.log(request, None, 'sign', 'Test receipt signing')
        receipt = create_test_receipt(data['root'], data['receipt_type'])
        return {'receipt': receipt, 'error': ''}

    return {'receipt': '', 'error': form.errors}
Esempio n. 12
0
 def obj_create(self, bundle, request=None, **kwargs):
     receipt_cef.log(request, None, 'sign', 'Test receipt signing')
     bundle.data = {'receipt': create_test_receipt(
         bundle.data['root'], bundle.data['receipt_type'])}
     return bundle
Esempio n. 13
0
 def test_verify(self):
     receipt = create_test_receipt("http://foo", "expired")
     res = self.client.post(reverse("receipt.test.verify", args=["expired"]), receipt, content_type="text/plain")
     eq_(json.loads(res.content)["status"], "expired")
Esempio n. 14
0
 def test_verify(self):
     req = RawRequestFactory().post(
         '/', create_test_receipt('http://foo', 'expired'))
     res = test_verify(req, 'expired')
     eq_(json.loads(res.content)['status'], 'expired')
Esempio n. 15
0
 def test_verify(self):
     req = RawRequestFactory().post('/',
         create_test_receipt('http://foo', 'expired'))
     res = test_verify(req, 'expired')
     eq_(json.loads(res.content)['status'], 'expired')
Esempio n. 16
0
 def test_verify(self):
     url = absolutify(reverse("receipt.test.verify", kwargs={"status": "expired"}))
     receipt = create_test_receipt("http://foo", "expired")
     req = RawRequestFactory().post(url, receipt)
     res = devhub_verify(req, "expired")
     eq_(json.loads(res.content)["status"], "expired")
Esempio n. 17
0
 def obj_create(self, bundle, request=None, **kwargs):
     receipt_cef.log(request, None, "sign", "Test receipt signing")
     bundle.data = {"receipt": create_test_receipt(bundle.data["root"], bundle.data["receipt_type"])}
     return bundle