diff --git a/docs/qa/docker.rst b/docs/qa/docker.rst index b118b16d..15176f0c 100644 --- a/docs/qa/docker.rst +++ b/docs/qa/docker.rst @@ -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 diff --git a/normandy/classifier/admin/views.py b/normandy/classifier/admin/views.py index 6e86cb62..1a3be257 100644 --- a/normandy/classifier/admin/views.py +++ b/normandy/classifier/admin/views.py @@ -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) diff --git a/normandy/classifier/tests/test_views.py b/normandy/classifier/tests/test_views.py index eaf3f963..446c22ad 100644 --- a/normandy/classifier/tests/test_views.py +++ b/normandy/classifier/tests/test_views.py @@ -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() diff --git a/normandy/recipes/tests/test_models.py b/normandy/recipes/tests/test_models.py index ad877c08..96e649aa 100644 --- a/normandy/recipes/tests/test_models.py +++ b/normandy/recipes/tests/test_models.py @@ -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])