Merge pull request #253 from pubs/fix/252
Fix collision of entry type key with valid field name 'type'.
This commit is contained in:
commit
60b424a745
@ -7,7 +7,7 @@ from .p3 import ustr, uchr
|
||||
|
||||
# Citekey stuff
|
||||
|
||||
TYPE_KEY = 'type'
|
||||
TYPE_KEY = 'ENTRYTYPE'
|
||||
|
||||
CONTROL_CHARS = ''.join(map(uchr, list(range(0, 32)) + list(range(127, 160))))
|
||||
CITEKEY_FORBIDDEN_CHARS = '@\'\\,#}{~%/ ' # '/' is OK for bibtex but forbidden
|
||||
|
@ -57,6 +57,12 @@ class TestEnDecode(unittest.TestCase):
|
||||
|
||||
self.assertEqual(bibraw1, bibraw2)
|
||||
|
||||
def test_decode_bibtex_preserves_type_field(self):
|
||||
"""Test that multiple encode/decode step preserve data"""
|
||||
decoder = endecoder.EnDecoder()
|
||||
entry = decoder.decode_bibdata(bibtex_raw0)
|
||||
self.assertEqual(entry['Page99']['type'], "technical report")
|
||||
|
||||
def test_endecode_bibtex_BOM(self):
|
||||
"""Test that bibtexparser if fine with BOM-prefixed data"""
|
||||
decoder = endecoder.EnDecoder()
|
||||
|
Loading…
x
Reference in New Issue
Block a user