mirror of
https://github.com/ae-utbm/sith.git
synced 2024-10-31 19:38:04 +00:00
Merge branch 'bugfix' into 'master'
com/core: remove links to index edition that caused error 500 See merge request ae/Sith!230
This commit is contained in:
commit
8a16a66299
22
com/tests.py
22
com/tests.py
@ -33,6 +33,28 @@ from django.utils.translation import ugettext as _
|
|||||||
from core.models import User, RealGroup
|
from core.models import User, RealGroup
|
||||||
|
|
||||||
|
|
||||||
|
class ComAlertTest(TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
call_command("populate")
|
||||||
|
|
||||||
|
def test_page_is_working(self):
|
||||||
|
self.client.login(username="comunity", password="plop")
|
||||||
|
response = self.client.get(reverse("com:alert_edit"))
|
||||||
|
self.assertNotEquals(response.status_code, 500)
|
||||||
|
self.assertEquals(response.status_code, 200)
|
||||||
|
|
||||||
|
|
||||||
|
class ComInfoTest(TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
call_command("populate")
|
||||||
|
|
||||||
|
def test_page_is_working(self):
|
||||||
|
self.client.login(username="comunity", password="plop")
|
||||||
|
response = self.client.get(reverse("com:info_edit"))
|
||||||
|
self.assertNotEquals(response.status_code, 500)
|
||||||
|
self.assertEquals(response.status_code, 200)
|
||||||
|
|
||||||
|
|
||||||
class ComTest(TestCase):
|
class ComTest(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
call_command("populate")
|
call_command("populate")
|
||||||
|
@ -114,9 +114,6 @@ class ComTabsMixin(TabedViewMixin):
|
|||||||
"name": _("Weekmail destinations"),
|
"name": _("Weekmail destinations"),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
tab_list.append(
|
|
||||||
{"url": reverse("com:index_edit"), "slug": "index", "name": _("Index page")}
|
|
||||||
)
|
|
||||||
tab_list.append(
|
tab_list.append(
|
||||||
{"url": reverse("com:info_edit"), "slug": "info", "name": _("Info message")}
|
{"url": reverse("com:info_edit"), "slug": "info", "name": _("Info message")}
|
||||||
)
|
)
|
||||||
|
@ -83,7 +83,6 @@
|
|||||||
<li><a href="{{ url('com:weekmail_destinations') }}">{% trans %}Weekmail destinations{% endtrans %}</a></li>
|
<li><a href="{{ url('com:weekmail_destinations') }}">{% trans %}Weekmail destinations{% endtrans %}</a></li>
|
||||||
<li><a href="{{ url('com:news_new') }}">{% trans %}Create news{% endtrans %}</a></li>
|
<li><a href="{{ url('com:news_new') }}">{% trans %}Create news{% endtrans %}</a></li>
|
||||||
<li><a href="{{ url('com:news_admin_list') }}">{% trans %}Moderate news{% endtrans %}</a></li>
|
<li><a href="{{ url('com:news_admin_list') }}">{% trans %}Moderate news{% endtrans %}</a></li>
|
||||||
<li><a href="{{ url('com:index_edit') }}">{% trans %}Edit index page{% endtrans %}</a></li>
|
|
||||||
<li><a href="{{ url('com:alert_edit') }}">{% trans %}Edit alert message{% endtrans %}</a></li>
|
<li><a href="{{ url('com:alert_edit') }}">{% trans %}Edit alert message{% endtrans %}</a></li>
|
||||||
<li><a href="{{ url('com:info_edit') }}">{% trans %}Edit information message{% endtrans %}</a></li>
|
<li><a href="{{ url('com:info_edit') }}">{% trans %}Edit information message{% endtrans %}</a></li>
|
||||||
<li><a href="{{ url('core:file_moderation') }}">{% trans %}Moderate files{% endtrans %}</a></li>
|
<li><a href="{{ url('core:file_moderation') }}">{% trans %}Moderate files{% endtrans %}</a></li>
|
||||||
|
@ -405,11 +405,30 @@ class UserToolsTest(TestCase):
|
|||||||
self.assertEquals(response.status_code, 403)
|
self.assertEquals(response.status_code, 403)
|
||||||
|
|
||||||
def test_page_is_working(self):
|
def test_page_is_working(self):
|
||||||
|
# Test for simple user
|
||||||
self.client.login(username="guy", password="plop")
|
self.client.login(username="guy", password="plop")
|
||||||
response = self.client.get(reverse("core:user_tools"))
|
response = self.client.get(reverse("core:user_tools"))
|
||||||
self.assertNotEquals(response.status_code, 500)
|
self.assertNotEquals(response.status_code, 500)
|
||||||
self.assertEquals(response.status_code, 200)
|
self.assertEquals(response.status_code, 200)
|
||||||
|
|
||||||
|
# Test for root
|
||||||
|
self.client.login(username="root", password="plop")
|
||||||
|
response = self.client.get(reverse("core:user_tools"))
|
||||||
|
self.assertNotEquals(response.status_code, 500)
|
||||||
|
self.assertEquals(response.status_code, 200)
|
||||||
|
|
||||||
|
# Test for skia
|
||||||
|
self.client.login(username="skia", password="plop")
|
||||||
|
response = self.client.get(reverse("core:user_tools"))
|
||||||
|
self.assertNotEquals(response.status_code, 500)
|
||||||
|
self.assertEquals(response.status_code, 200)
|
||||||
|
|
||||||
|
# Test for comunity
|
||||||
|
self.client.login(username="comunity", password="plop")
|
||||||
|
response = self.client.get(reverse("core:user_tools"))
|
||||||
|
self.assertNotEquals(response.status_code, 500)
|
||||||
|
self.assertEquals(response.status_code, 200)
|
||||||
|
|
||||||
|
|
||||||
# TODO: many tests on the pages:
|
# TODO: many tests on the pages:
|
||||||
# - renaming a page
|
# - renaming a page
|
||||||
|
Loading…
Reference in New Issue
Block a user