File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import pytz
66import xml2rfc
77import tempfile
8+ from unidecode import unidecode
89
910from django import forms
1011from django .conf import settings
@@ -170,8 +171,12 @@ def clean(self):
170171 else :
171172 self .revision = None
172173 self .filename = draftname
173- self .title = self .xmlroot .findtext ('front/title' )
174- self .abstract = self .xmlroot .findtext ('front/abstract' )
174+ self .title = self .xmlroot .findtext ('front/title' ).strip ()
175+ if type (self .title ) is unicode :
176+ self .title = unidecode (self .title )
177+ self .abstract = self .xmlroot .findtext ('front/abstract' ).strip ()
178+ if type (self .abstract ) is unicode :
179+ self .abstract = unidecode (self .abstract )
175180 self .author_list = []
176181 author_info = self .xmlroot .findall ('front/author' )
177182 for author in author_info :
Original file line number Diff line number Diff line change 1- <?xml version =" 1.0" encoding =" US-ASCII " ?>
1+ <?xml version =" 1.0" encoding =" UTF-8 " ?>
22<!DOCTYPE rfc SYSTEM "rfc2629.dtd" []>
33<?rfc toc =" yes" ?>
44<rfc category =" info" docName =" %(name)s" ipr =" trust200902" >
55 <front >
6- <title >Testing Tests</title >
6+ <title >Testing Tests</title >
77 <author fullname =" Author Name" initials =" A." surname =" Name" >
88 <organization >Test Centre Inc.</organization >
99
Original file line number Diff line number Diff line change @@ -796,7 +796,7 @@ def test_submit_all_file_types(self):
796796 self .assertTrue (name in open (os .path .join (self .staging_dir , u"%s-%s.txt" % (name , rev ))).read ())
797797 self .assertTrue (os .path .exists (os .path .join (self .staging_dir , u"%s-%s.xml" % (name , rev ))))
798798 self .assertTrue (name in open (os .path .join (self .staging_dir , u"%s-%s.xml" % (name , rev ))).read ())
799- self .assertTrue ('<?xml version="1.0" encoding="US-ASCII "?>' in open (os .path .join (self .staging_dir , u"%s-%s.xml" % (name , rev ))).read ())
799+ self .assertTrue ('<?xml version="1.0" encoding="UTF-8 "?>' in open (os .path .join (self .staging_dir , u"%s-%s.xml" % (name , rev ))).read ())
800800 self .assertTrue (os .path .exists (os .path .join (self .staging_dir , u"%s-%s.pdf" % (name , rev ))))
801801 self .assertTrue ('This is PDF' in open (os .path .join (self .staging_dir , u"%s-%s.pdf" % (name , rev ))).read ())
802802 self .assertTrue (os .path .exists (os .path .join (self .staging_dir , u"%s-%s.ps" % (name , rev ))))
You can’t perform that action at this time.
0 commit comments