This commit is contained in:
Michael Kelly 2016-03-02 13:35:46 -08:00
Родитель 5f3edf28fd
Коммит bc8b2aa446
4 изменённых файлов: 10 добавлений и 4 удалений

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

@ -92,6 +92,8 @@ Running Normandy
docker run -it --env-file=.env mozilla/normandy:latest ./manage.py migrate
# Create a super user
docker run -t --env-file=.env mozilla/normandy:latest ./manage.py createsuperuser
# Load inital database data
docker run -t --env-file=.env mozilla/normandy:latest ./manage.py initial_data
# Run the web server
docker run -t -p 8000:8000 --env-file=.env mozilla/normandy:latest

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

@ -13,6 +13,7 @@ def classifier_preview(request):
client = form.save()
bundle = Bundle.for_client(client, exclude=[match_sample_rate])
else:
client = None
bundle = None
ctx = admin_site.each_context(request)

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

@ -10,6 +10,10 @@ from normandy.recipes.tests import (
@pytest.mark.django_db
class TestClientClassifier(object):
def test_classify_initial(self, admin_client):
response = admin_client.get('/admin/classifier_preview')
assert response.status_code == 200
def test_classify(self, admin_client):
locale, other_locale = LocaleFactory.create_batch(2)
country = CountryFactory()

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

@ -137,10 +137,9 @@ class TestRecipe(object):
assert recipe.matches(client, exclude=[match_enabled])
def test_filter_exclude_many(self):
locale1, locale2 = LocaleFactory.create_batch(2)
locale2 = LocaleFactory()
recipe = RecipeFactory(locales=[locale1])
client = ClientFactory(locale=locale2.code)
locale_match1, locale_match2, locale_not = LocaleFactory.create_batch(3)
recipe = RecipeFactory(locales=[locale_match1, locale_match2])
client = ClientFactory(locale=locale_not.code)
assert not recipe.matches(client)
assert recipe.matches(client, exclude=[get_locales])