Repository: scieloorg/xylose

Issue:
Considerar campo v435 para obtenção dos tipos de ISSNs
Incluir na análise o campo v435 para obtenção do ISSN na classe Journal.

Ex.: Biota Neotropica

35  "ONLIN"
400  "1676-0603"
**435  "1678-6424^tPRINT"
435  "1676-0611^tONLIN"**
935  "1676-0611"



Discussion:

Patch:
diff --git a/xylose/scielodocument.py b/xylose/scielodocument.py
index becd530..15d73da 100644
--- a/xylose/scielodocument.py
+++ b/xylose/scielodocument.py
@@ -69,8 +69,17 @@ class Journal(object):
         """
         This method creates an object level attributes (print_issn and/or
         electronic issn), according to the given metadata.
-        This method deal with the legacy datamodel fields (935, 400, 35) where:
+        This method deal with the legacy datamodel fields (935, 400, 35, 435) where:
         """
+
+        if 'v435' in self.data:
+            for item in self.data['v435']:
+                if 't' in item and item['t'] == 'PRINT':
+                    self.print_issn = item['_']
+                if 't' in item and item['t'] == 'ONLIN':
+                    self.electronic_issn = item['_']
+            return None
+
         if not 'v35' in self.data:
             return None
 


Test patch:
diff --git a/tests/test_document.py b/tests/test_document.py
index 8b47b82..fa8d4c2 100644
--- a/tests/test_document.py
+++ b/tests/test_document.py
@@ -284,6 +284,19 @@ class JournalTests(unittest.TestCase):
 
         self.assertEqual(journal.update_date, '2012-08-24')
 
+    def test_load_issn_with_v435(self):
+        self.fulldoc['title']['v35'] = [{u'_': u'PRINT'}]
+        self.fulldoc['title']['v400'] = [{u'_': u'2222-2222'}]
+        self.fulldoc['title']['v435'] = [
+            {u'_': u'0000-0000', 't': 'ONLIN'},
+            {u'_': u'9999-9999', 't': 'PRINT'}
+        ]
+
+        journal = Journal(self.fulldoc['title'])
+
+        self.assertEqual(journal.print_issn, u'9999-9999')
+        self.assertEqual(journal.electronic_issn, u'0000-0000')
+
     def test_load_issn_with_v935_without_v35(self):
         del(self.fulldoc['title']['v35'])
         self.fulldoc['title']['v400'] = [{u'_': u'2222-2222'}]