From 29742aa7583316f5b91c1367a4782d6fd02a9822 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sat, 26 Aug 2017 18:52:49 +0200 Subject: Django 1.11: fix dashboards - explicit ordering is needed when using distinct --- archaeological_files/tests.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'archaeological_files/tests.py') diff --git a/archaeological_files/tests.py b/archaeological_files/tests.py index 60f447c62..8a1069d51 100644 --- a/archaeological_files/tests.py +++ b/archaeological_files/tests.py @@ -25,7 +25,7 @@ from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.test.client import Client -from ishtar_common.tests import TestCase, COMMON_FIXTURES +from ishtar_common.tests import TestCase, COMMON_FIXTURES, create_superuser from ishtar_common.models import Town, IshtarSiteProfile from archaeological_files import models @@ -271,3 +271,21 @@ class FileOperationTest(TestCase, OperationInitTest, FileInit): q = ParcelOwner.objects.filter(parcel__operation=self.operation, parcel__parcel_number='42') self.assertEqual(q.count(), 1) + + +class DashboardTest(TestCase, FileInit): + fixtures = FILE_TOWNS_FIXTURES + model = models.File + + def setUp(self): + self.username, self.password, self.user = create_superuser() + IshtarSiteProfile.objects.create() + self.create_file() + + def test_dashboard(self): + url = 'dashboard-file' + c = Client() + c.login(username=self.username, password=self.password) + + response = c.get(reverse(url)) + self.assertEqual(response.status_code, 200) -- cgit v1.2.3