stop inapp blowing up amo tests
This commit is contained in:
Родитель
7d662d9ab2
Коммит
77b35d065f
|
@ -27,7 +27,6 @@ from waffle.models import Flag, Sample, Switch
|
|||
|
||||
import addons.search
|
||||
import amo
|
||||
import mkt.stats.search
|
||||
import stats.search
|
||||
from access.models import Group, GroupUser
|
||||
from addons.models import Addon, AddonCategory, Category, Persona
|
||||
|
@ -563,7 +562,9 @@ class ESTestCase(TestCase):
|
|||
|
||||
addons.search.setup_mapping()
|
||||
stats.search.setup_indexes()
|
||||
mkt.stats.search.setup_mkt_indexes()
|
||||
if settings.MARKETPLACE:
|
||||
import mkt.stats.search
|
||||
mkt.stats.search.setup_mkt_indexes()
|
||||
|
||||
@classmethod
|
||||
def setUpIndex(cls):
|
||||
|
|
|
@ -41,8 +41,6 @@ from devhub.models import ActivityLog
|
|||
from files.models import Approval, File
|
||||
from files.tasks import start_upgrade as start_upgrade_task
|
||||
from files.utils import find_jetpacks, JetpackUpgrader
|
||||
from mkt.stats.cron import index_latest_mkt_stats, index_mkt_stats
|
||||
from mkt.stats.search import setup_mkt_indexes
|
||||
from stats.cron import index_latest_stats
|
||||
from stats.search import setup_indexes
|
||||
from users.cron import reindex_users
|
||||
|
@ -61,6 +59,15 @@ from .models import EmailPreviewTopic, ValidationJob, ValidationJobTally
|
|||
|
||||
log = commonware.log.getLogger('z.zadmin')
|
||||
|
||||
# This causes AMO problems if inapp gets imported. Then cache machine tries
|
||||
# to query it to see if it exists.
|
||||
if settings.MARKETPLACE and settings.IN_TEST_SUITE:
|
||||
from mkt.stats.cron import index_latest_mkt_stats, index_mkt_stats
|
||||
from mkt.stats.search import setup_mkt_indexes
|
||||
else:
|
||||
index_latest_mkt_stats, index_mkt_stats = None, None
|
||||
setup_mkt_indexes = None
|
||||
|
||||
|
||||
@admin_required(reviewers=True)
|
||||
def flagged(request):
|
||||
|
|
Загрузка…
Ссылка в новой задаче