stop inapp blowing up amo tests

This commit is contained in:
Andy McKay 2012-08-24 12:12:51 -07:00
Родитель 7d662d9ab2
Коммит 77b35d065f
2 изменённых файлов: 12 добавлений и 4 удалений

Просмотреть файл

@ -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):