diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-09 17:09:40 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-09 17:09:40 +0100 | 
| commit | 6353433923e836f7eca3066d474f85c5bb19b0a1 (patch) | |
| tree | 6571aa9b30627e622b4d28cdddc47a4d8a61bd87 | |
| parent | d51a6640733fab3940688898668b83eb26592696 (diff) | |
| download | Ishtar-6353433923e836f7eca3066d474f85c5bb19b0a1.tar.bz2 Ishtar-6353433923e836f7eca3066d474f85c5bb19b0a1.zip | |
Operation tables: adapt columns (refs #3501, refs #3509)
| -rw-r--r-- | archaeological_operations/models.py | 8 | ||||
| -rw-r--r-- | archaeological_operations/tests.py | 9 | 
2 files changed, 8 insertions, 9 deletions
| diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index e74d02647..ba82d4fe7 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -177,9 +177,9 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms,                  ValueGetter, ShortMenuItem, DashboardFormItem):      QUALITY_DICT = dict(QUALITY)      SHOW_URL = 'show-operation' -    TABLE_COLS = ['year_index', 'operation_type', 'remains', 'towns', -                  'associated_file_short_label', 'start_date', -                  'excavation_end_date'] +    TABLE_COLS = ['year', 'towns', 'common_name', 'operation_type', +                  'start_date', 'excavation_end_date', 'remains', +                  'associated_file_short_label']      IMAGE_PREFIX = 'operations/'      SLUG = 'operation' @@ -200,7 +200,6 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms,          'scientific_documentation_comment__icontains',          'abstract': 'abstract__icontains',          'end_date': 'end_date__isnull', -        'year_index': ('year', 'operation_code'),          'start_before': 'start_date__lte',          'start_after': 'start_date__gte',          'end_before': 'excavation_end_date__lte', @@ -231,7 +230,6 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms,      EXTRA_FULL_FIELDS_LABELS = {          'full_code_patriarche': u"Code patriarche", -        'year_index': _(u"Year - Index"),          'associated_file_short_label': _(u"Associated file (label)"),          'operator__name': _(u"Operator name"),          'scientist__raw_name': _(u"Scientist (full name)"), diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index c2d5aad83..1b64f581d 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -894,17 +894,18 @@ class OperationSearchTest(TestCase, OperationInitTest):          self.operations += self.create_operation(self.alt_user, self.orgas[0])          self.item = self.operations[0] -    def testBaseSearch(self): +    def test_base_search(self):          c = Client()          response = c.get(reverse('get-operation'), {'year': '2010'}) -        # no result when no authentification +        # no result when no authentication          self.assertTrue(not json.loads(response.content))          c.login(username=self.username, password=self.password)          response = c.get(reverse('get-operation'), {'year': '2010'}) -        self.assertTrue(json.loads(response.content)['total'] == 2) +        self.assertEqual(json.loads(response.content)['total'], 2)          response = c.get(reverse('get-operation'),                           {'operator': self.orgas[0].pk}) -        self.assertTrue(json.loads(response.content)['total'] == 2) +        result = json.loads(response.content) +        self.assertEqual(result['total'], 2)      def create_relations(self):          rel1 = models.RelationType.objects.create( | 
