fix tests
This commit is contained in:
Родитель
a36822f063
Коммит
2f452f68d1
|
@ -23,7 +23,7 @@ from mkt.site.fixtures import fixture
|
|||
from mkt.webapps.models import Webapp
|
||||
from mkt.receipts.utils import create_test_receipt
|
||||
from mkt.receipts.views import test_verify
|
||||
from services.verify import decode_receipt
|
||||
from services.verify import decode_receipt, settings as verify_settings
|
||||
from users.models import UserProfile
|
||||
from zadmin.models import DownloadSource
|
||||
|
||||
|
@ -425,6 +425,11 @@ class RawRequestFactory(RequestFactory):
|
|||
return data
|
||||
|
||||
|
||||
# Ooof.
|
||||
@mock.patch.object(verify_settings, 'WEBAPPS_RECEIPT_KEY',
|
||||
amo.tests.AMOPaths.sample_key())
|
||||
@mock.patch.object(settings, 'WEBAPPS_RECEIPT_KEY',
|
||||
amo.tests.AMOPaths.sample_key())
|
||||
class TestDevhubReceipts(amo.tests.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
|
|
@ -5,6 +5,7 @@ from urllib import urlencode
|
|||
from django.conf import settings
|
||||
|
||||
import jwt
|
||||
from nose.tools import nottest
|
||||
|
||||
from access import acl
|
||||
from amo.helpers import absolutify
|
||||
|
@ -58,6 +59,7 @@ def create_receipt(installed_pk, flavour=None):
|
|||
return jwt.encode(receipt, get_key(), u'RS512')
|
||||
|
||||
|
||||
@nottest
|
||||
def create_test_receipt(status):
|
||||
time_ = calendar.timegm(time.gmtime())
|
||||
detail = absolutify(reverse('receipt.test.details'))
|
||||
|
|
|
@ -5,6 +5,7 @@ from django.views.decorators.csrf import csrf_exempt
|
|||
|
||||
import commonware.log
|
||||
import jingo
|
||||
from nose.tools import nottest
|
||||
from session_csrf import anonymous_csrf_exempt
|
||||
from tower import ugettext as _
|
||||
|
||||
|
@ -249,6 +250,7 @@ def test_details(request):
|
|||
@csrf_exempt
|
||||
@json_view
|
||||
@post_required
|
||||
@nottest
|
||||
def test_verify(request, status):
|
||||
try:
|
||||
result = decode_receipt(request.body)
|
||||
|
|
Загрузка…
Ссылка в новой задаче