mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 20:39:23 +00:00
All: Apply Black coding rules
This commit is contained in:
34
com/tests.py
34
com/tests.py
@ -34,25 +34,43 @@ class ComTest(TestCase):
|
||||
def setUp(self):
|
||||
call_command("populate")
|
||||
self.skia = User.objects.filter(username="skia").first()
|
||||
self.com_group = RealGroup.objects.filter(id=settings.SITH_GROUP_COM_ADMIN_ID).first()
|
||||
self.com_group = RealGroup.objects.filter(
|
||||
id=settings.SITH_GROUP_COM_ADMIN_ID
|
||||
).first()
|
||||
self.skia.groups = [self.com_group]
|
||||
self.skia.save()
|
||||
self.client.login(username=self.skia.username, password='plop')
|
||||
self.client.login(username=self.skia.username, password="plop")
|
||||
|
||||
def test_alert_msg(self):
|
||||
response = self.client.post(reverse("com:alert_edit"), {"alert_msg": """
|
||||
response = self.client.post(
|
||||
reverse("com:alert_edit"),
|
||||
{
|
||||
"alert_msg": """
|
||||
### ALERTE!
|
||||
|
||||
**Caaaataaaapuuuulte!!!!**
|
||||
"""})
|
||||
"""
|
||||
},
|
||||
)
|
||||
r = self.client.get(reverse("core:index"))
|
||||
self.assertTrue(r.status_code == 200)
|
||||
self.assertTrue("""<div id="alert_box">\\n <div class="markdown"><h3>ALERTE!</h3>\\n<p><strong>Caaaataaaapuuuulte!!!!</strong></p>""" in str(r.content))
|
||||
self.assertTrue(
|
||||
"""<div id="alert_box">\\n <div class="markdown"><h3>ALERTE!</h3>\\n<p><strong>Caaaataaaapuuuulte!!!!</strong></p>"""
|
||||
in str(r.content)
|
||||
)
|
||||
|
||||
def test_info_msg(self):
|
||||
response = self.client.post(reverse("com:info_edit"), {"info_msg": """
|
||||
response = self.client.post(
|
||||
reverse("com:info_edit"),
|
||||
{
|
||||
"info_msg": """
|
||||
### INFO: **Caaaataaaapuuuulte!!!!**
|
||||
"""})
|
||||
"""
|
||||
},
|
||||
)
|
||||
r = self.client.get(reverse("core:index"))
|
||||
self.assertTrue(r.status_code == 200)
|
||||
self.assertTrue("""<div id="info_box">\\n <div class="markdown"><h3>INFO: <strong>Caaaataaaapuuuulte!!!!</strong></h3>""" in str(r.content))
|
||||
self.assertTrue(
|
||||
"""<div id="info_box">\\n <div class="markdown"><h3>INFO: <strong>Caaaataaaapuuuulte!!!!</strong></h3>"""
|
||||
in str(r.content)
|
||||
)
|
||||
|
Reference in New Issue
Block a user