WMDE
/
eva
forked from tohe/eva
7
1
Fork 0

testmode warning

This commit is contained in:
Benni Bärmann 2021-09-14 09:58:41 +02:00
parent 39cee37be8
commit 4229928aae
4 changed files with 7 additions and 4 deletions

2
TODO
View File

@ -4,6 +4,4 @@
* enforce Mac OS if Mac is choosen?
* Maintainance-Anzeige im Debugmodus, damit niemand denkt, es würden mails verschickt.
* better error handling with mail sending.

View File

@ -29,6 +29,9 @@
</style>
<img src="{% static 'evapp/logo.png' %}" />
{% if TESTMODE %}
<h1 style="background-color:red;color:white">WARNUNG! Test-MODUS aktiviert. Es werden keine Mails verschickt!</h1>
{% endif %}
<h1>
E (V A) - Eintritt, (Veränderung, Austritt)<p>
</h1>Du bist eingeloggt als {{ user.email }}

View File

@ -20,7 +20,7 @@ class LoginTestCase(TestCase):
self.assertContains(self.response, "WARNUNG! Test-MODUS aktiviert. Es werden keine Mails verschickt!", status_code=200)
class SimpleTest(TestCase):
class NoLoginTestCase(TestCase):
def setUp(self):
self.client = Client()

View File

@ -83,8 +83,10 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView):
#print('GETCONTEXT')
context = super().get_context_data(form=form, **kwargs)
#testmode = settings.DEBUG or settings.MAILTEST
context.update({'choice': self.choice,
'choice_string': TYPE_CHOICES[self.choice]})
'choice_string': TYPE_CHOICES[self.choice],
'TESTMODE': settings.DEBUG or settings.MAILTEST})
# deliver context for forms if we are in the last step
if (self.steps.step1 == 5 or (self.choice != 'IN' and self.steps.step1 == 3)):