core: add tests for UserToolsView

This commit is contained in:
Antoine Bartuccio 2019-07-15 12:36:05 +02:00
parent 9b7b96a310
commit 640a72c52d
Signed by: klmp200
GPG Key ID: E7245548C53F904B
1 changed files with 15 additions and 0 deletions

View File

@ -396,6 +396,21 @@ http://git.an
)
class UserToolsTest(TestCase):
def setUp(self):
call_command("populate")
def test_anonymous_user_unauthorized(self):
response = self.client.get(reverse("core:user_tools"))
self.assertEquals(response.status_code, 403)
def test_page_is_working(self):
self.client.login(username="guy", 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:
# - renaming a page
# - changing a page's parent --> check that page's children's full_name