Use the syncmail command as defined in custommail

This commit is contained in:
Martin Pépin 2018-10-07 00:55:54 +02:00
parent 26b19685b8
commit 9da9649a45
3 changed files with 13 additions and 93 deletions

View file

@ -1,9 +1,12 @@
import json
import os
from datetime import timedelta
from unittest import mock
from urllib.parse import urlencode
from django.conf import settings
from django.contrib.auth.models import User
from django.core.management import call_command
from django.test import Client, TestCase
from django.utils import timezone
@ -49,9 +52,10 @@ class BdATestHelpers:
]
def require_custommails(self):
from django.core.management import call_command
call_command("syncmails", verbosity=0)
data_file = os.path.join(
settings.BASE_DIR, "gestioncof", "management", "data", "custommail.json"
)
call_command("syncmails", data_file, verbosity=0)
def check_restricted_access(
self, url, validate_user=user_is_cof, redirect_url=None