[profile generation] Fix concept language used in case of SEDA 0.2 export
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 24 Aug 2017 16:23:36 +0200
changeset 2662 3572864fe580
parent 2661 21de2d5db256
child 2663 274dcd2aafbf
[profile generation] Fix concept language used in case of SEDA 0.2 export We should override the concepts_language class attribute else we'll use the inherited 'seda-1' language.
cubicweb_seda/entities/profile_generation.py
test/test_profile_generation.py
--- a/cubicweb_seda/entities/profile_generation.py	Thu Aug 24 16:22:07 2017 +0200
+++ b/cubicweb_seda/entities/profile_generation.py	Thu Aug 24 16:23:36 2017 +0200
@@ -1130,6 +1130,8 @@
     root_attributes['targetNamespace'] = 'fr:gouv:ae:archive:draft:standard_echange_v0.2'
     root_attributes['version'] = '1.1'
 
+    concepts_language = 'seda-02'
+
     def xsd_transfer(self, parent, archive_transfer):
         """Append XSD elements for the archive transfer to the given parent node."""
         transfer_node = self.xsd_transfer_base(parent, archive_transfer)
--- a/test/test_profile_generation.py	Thu Aug 24 16:22:07 2017 +0200
+++ b/test/test_profile_generation.py	Thu Aug 24 16:23:36 2017 +0200
@@ -23,6 +23,7 @@
 from itertools import chain, izip, repeat
 import os
 from os.path import basename, join
+import unittest
 
 from six import binary_type, text_type
 
@@ -917,6 +918,12 @@
         self.check_xsd_profile(root, self.datapath('seda_02_bordereau_ref.xml'))
 
 
+class SEDAExportUnitTest(unittest.TestCase):
+
+    def test_concepts_languages(self):
+        self.assertEqual(pg.SEDA1XSDExport.concepts_language, 'seda-1')
+        self.assertEqual(pg.SEDA02XSDExport.concepts_language, 'seda-02')
+
+
 if __name__ == '__main__':
-    import unittest
     unittest.main()