In Django 1.9, CharField form fields will be whitespace-stripped by default. Added strip=False for the status change review form content. Also removed a superfluous f.close().

- Legacy-Id: 12677
This commit is contained in:
Henrik Levkowetz 2017-01-19 17:15:28 +00:00
parent 7c2a161a5f
commit fd2304e446
2 changed files with 1 additions and 2 deletions

View file

@ -417,7 +417,6 @@ class StatusChangeSubmitTests(TestCase):
self.assertEqual(doc.rev,u'00')
with open(path) as f:
self.assertEqual(f.read(),"Some initial review text\n")
f.close()
self.assertTrue( "mid-review-00" in doc.latest_event(NewRevisionDocEvent).desc)
def test_subsequent_submission(self):

View file

@ -108,7 +108,7 @@ def send_status_change_eval_email(request,doc):
send_mail_preformatted(request,msg,override=override)
class UploadForm(forms.Form):
content = forms.CharField(widget=forms.Textarea, label="Status change text", help_text="Edit the status change text.", required=False)
content = forms.CharField(widget=forms.Textarea, label="Status change text", help_text="Edit the status change text.", required=False, strip=False)
txt = forms.FileField(label=".txt format", help_text="Or upload a .txt file.", required=False)
def clean_content(self):