* Remove settings_test fixes #1363

* Set debug to false to suppress unnecessary console logs
This commit is contained in:
Jared Kerim 2019-08-23 16:49:09 -04:00 коммит произвёл GitHub
Родитель 68b83b4b00
Коммит 18bd761342
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 26 добавлений и 40 удалений

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

@ -29,12 +29,17 @@ class TestIntentToShipEmail(TestCase):
firefox_max_version="",
firefox_channel="Nightly",
)
sender = "sender@example.com"
release_drivers = "drivers@example.com"
user = UserFactory.create(email="smith@example.com")
experiment.subscribers.add(user)
send_intent_to_ship_email(experiment.id)
with self.settings(
EMAIL_SENDER=sender, EMAIL_RELEASE_DRIVERS=release_drivers
):
send_intent_to_ship_email(experiment.id)
bug_url = settings.BUGZILLA_DETAIL_URL.format(
id=experiment.bugzilla_id
@ -48,15 +53,11 @@ class TestIntentToShipEmail(TestCase):
sent_email.subject,
"SHIELD Study Intent to ship: Experiment 56.0 Nightly",
)
self.assertEqual(sent_email.from_email, settings.EMAIL_SENDER)
self.assertEqual(sent_email.from_email, sender)
self.assertEqual(
set(sent_email.recipients()),
set(
[
settings.EMAIL_RELEASE_DRIVERS,
experiment.owner.email,
"smith@example.com",
]
[release_drivers, experiment.owner.email, "smith@example.com"]
),
)
self.assertTrue(
@ -90,8 +91,13 @@ class TestIntentToShipEmail(TestCase):
user = UserFactory.create(email="smith@example.com")
experiment.subscribers.add(user)
sender = "sender@example.com"
release_drivers = "drivers@example.com"
send_intent_to_ship_email(experiment.id)
with self.settings(
EMAIL_SENDER=sender, EMAIL_RELEASE_DRIVERS=release_drivers
):
send_intent_to_ship_email(experiment.id)
bug_url = settings.BUGZILLA_DETAIL_URL.format(
id=experiment.bugzilla_id
@ -114,15 +120,11 @@ class TestIntentToShipEmail(TestCase):
f"Timeline & Channel: {expected_version_channel}", sent_email.body
)
self.assertEqual(sent_email.content_subtype, "html")
self.assertEqual(sent_email.from_email, settings.EMAIL_SENDER)
self.assertEqual(sent_email.from_email, sender)
self.assertEqual(
set(sent_email.recipients()),
set(
[
settings.EMAIL_RELEASE_DRIVERS,
experiment.owner.email,
"smith@example.com",
]
[release_drivers, experiment.owner.email, "smith@example.com"]
),
)

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

@ -809,11 +809,13 @@ class TestExperimentCreateView(TestCase):
"owner": user.id,
}
response = self.client.post(
reverse("experiments-create"),
data,
**{settings.OPENIDC_EMAIL_HEADER: user_email},
)
with self.settings(BUGZILLA_HOST="https://bugzilla.mozilla.org"):
response = self.client.post(
reverse("experiments-create"),
data,
**{settings.OPENIDC_EMAIL_HEADER: user_email},
)
self.assertEqual(response.status_code, 302)
experiment = Experiment.objects.get()

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

@ -1,20 +0,0 @@
from experimenter.settings import *
DEBUG = False
LOGGING = {
"version": 1,
"disable_existing_loggers": True,
"formatters": {},
"handlers": {},
"loggers": {},
}
HOSTNAME = "experimenter.moz"
EMAIL_REVIEW = "testreview@example.com"
EMAIL_SHIP = "testship@example.com"
EMAIL_SENDER = "sender@example.com"
EMAIL_RELEASE_DRIVERS = "release.drivers@example.com"
USE_GOOGLE_ANALYTICS = True

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

@ -1,6 +1,6 @@
# -- FILE: pytest.ini (or tox.ini)
[pytest]
DJANGO_SETTINGS_MODULE = experimenter.settings_test
DJANGO_SETTINGS_MODULE = experimenter.settings
# -- recommended but optional:
addopts = -p no:warnings
python_files = tests.py test_*.py *_tests.py

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

@ -4,6 +4,8 @@ services:
app:
image: app:build
env_file: .env.sample
environment:
- DEBUG=False
volumes:
- ./app:/app
links: