This PR introduces a suite of tests for the Django settings of the remote-office-hours-queue project, as well as solving the issue mentioned in #458 . The test_settings.py is aimed to catch potential configuration errors early in the development process and maintain a higher standard of reliability. Right now the current app code passes all the setting tests.
Reviewer Notes:
For some setting variables that take value by using os.getenv() without setting a default value, sometimes there may not be a value for them and therefore these variables are None type. I am not sure if it is right to raise an error when calling something like self.assertEqual(settings.EMAIL_HOST, settings.EMAIL_HOST.strip()) (Here EMAIL_HOST is a None type as we tested and same thing happens for some other variables), so right now we are using if ... not None before testing them. Feel free to leave comment if it is not appropriate.
Any feedback on the testing approach and any potential edge cases that might not be covered is highly appreciated!
This PR introduces a suite of tests for the Django settings of the remote-office-hours-queue project, as well as solving the issue mentioned in #458 . The
test_settings.py
is aimed to catch potential configuration errors early in the development process and maintain a higher standard of reliability. Right now the current app code passes all the setting tests.Reviewer Notes:
For some setting variables that take value by using
os.getenv()
without setting a default value, sometimes there may not be a value for them and therefore these variables areNone
type. I am not sure if it is right to raise an error when calling something likeself.assertEqual(settings.EMAIL_HOST, settings.EMAIL_HOST.strip())
(HereEMAIL_HOST
is aNone
type as we tested and same thing happens for some other variables), so right now we are usingif ... not None
before testing them. Feel free to leave comment if it is not appropriate.Any feedback on the testing approach and any potential edge cases that might not be covered is highly appreciated!