summaryrefslogtreecommitdiff
path: root/ishtar_common/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-08-26 19:26:48 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-08-26 19:26:48 +0200
commit8fe3e5377aa2d498d43c7d0ad2637bc6ccc65e7e (patch)
treebac8fc13bb341e4c8a13386150bbf29689546748 /ishtar_common/tests.py
parent29742aa7583316f5b91c1367a4782d6fd02a9822 (diff)
downloadIshtar-8fe3e5377aa2d498d43c7d0ad2637bc6ccc65e7e.tar.bz2
Ishtar-8fe3e5377aa2d498d43c7d0ad2637bc6ccc65e7e.zip
Tests: simple tests for dashboard
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r--ishtar_common/tests.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py
index af2dee047..4afc74c9b 100644
--- a/ishtar_common/tests.py
+++ b/ishtar_common/tests.py
@@ -1105,3 +1105,33 @@ class AccountWizardTest(WizardTest, TestCase):
self.assertEqual(user.email, "test@example.com")
self.assertEqual(models.IshtarUser.objects.count(),
self.account_number + 1)
+
+
+class DashboardTest(TestCase):
+
+ def setUp(self):
+ self.username, self.password, self.user = create_superuser()
+ profile, created = models.IshtarSiteProfile.objects.get_or_create(
+ slug='default', active=True)
+ profile.files = True
+ profile.context_record = True
+ profile.find = True
+ profile.warehouse = True
+ profile.save()
+
+ def test_dashboard(self):
+ c = Client()
+ c.login(username=self.username, password=self.password)
+
+ url = 'dashboard-main-detail'
+
+ response = c.get(reverse(url, kwargs={'item_name': "zorglub"}))
+ self.assertEqual(
+ response.status_code, 404)
+
+ for item in ['users', 'files', 'treatmentfiles', 'treatments',
+ 'operations', 'contextrecords', 'finds']:
+ response = c.get(reverse(url, kwargs={'item_name': item}))
+ self.assertEqual(
+ response.status_code, 200,
+ "Reaching dashboard for item: {} return an error.".format(url))