scattenlaeufer / zapf-resotool

A bit of software to manage ZaPF resolutions
GNU Affero General Public License v3.0
4 stars 4 forks source link

Current approach of local testing settings fails to override email settings when testing sending mails with celery #12

Open scattenlaeufer opened 5 years ago

scattenlaeufer commented 5 years ago

Describe the bug Currently the tests for sending mails through Celery use a file called celery_mail_test_settings.toml to define the mail accounts to be used in the test. But the override_settings decorator doesn't seem to affect the email settings used my djcelery-email to send the mails. It still uses the settings from settings.py and if there are none, it fails due to an apparent lack of email settings. If there are email settings in settings.py the test succeeds, but it uses those settings instead of those

To Reproduce Steps to reproduce the behavior:

  1. Set up a Celery on your system
  2. Create a celery_mail_test_settings.toml as described in README.md
  3. Make sure there are no email settings in settings.py. If there are some, comment them out
  4. Start a Celery instance with make celery-run
  5. Run the tests with make test
  6. See an assertion error from the run tests and a ConnectionRefused exception in Celery

Expected behavior The tests should succeed

Additional context I hope this bug while at the latest be fixed once #11 gets resolved, but for now this bug should have a low priority due to it only affecting the tests. The actual feature of sending mails through Celery works.