forked from DGNum/gestioCOF
Load custommails before bda tests
This commit is contained in:
parent
e9b901337e
commit
c80e63415b
2 changed files with 70 additions and 63 deletions
|
@ -49,6 +49,10 @@ class BdATestHelpers:
|
|||
(None, Client())
|
||||
]
|
||||
|
||||
def require_custommails(self):
|
||||
from gestioncof.management.commands import syncmails
|
||||
syncmails.load_from_file()
|
||||
|
||||
def check_restricted_access(self, url, validate_user=user_is_cof, redirect_url=None):
|
||||
def craft_redirect_url(user):
|
||||
if redirect_url:
|
||||
|
@ -154,11 +158,11 @@ class TestBdAViews(BdATestHelpers, TestCase):
|
|||
self.check_restricted_access(url, validate_user=user_is_staff)
|
||||
|
||||
def test_send_reminders(self):
|
||||
self.require_custommails()
|
||||
# Just get the page
|
||||
url = "/bda/mails-rappel/{}".format(self.tirage.id)
|
||||
self.check_restricted_access(url, validate_user=user_is_staff)
|
||||
# Actually send the reminder emails
|
||||
# TODO: first load the emails into the database
|
||||
_, staff_c = self.client_matrix[0]
|
||||
resp = staff_c.post(url)
|
||||
self.assertEqual(200, resp.status_code)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue