fixed test mistake & bug in Edit This

This commit is contained in:
Philip Sargent
2021-05-02 22:47:59 +01:00
parent 51da26564f
commit 4782f3b184
2 changed files with 4 additions and 6 deletions

View File

@@ -91,9 +91,9 @@ class PostTests(TestCase):
content = response.content.decode()
self.assertEqual(response.status_code, 200)
self.assertEqual(response.status_code, HTTPStatus.OK)
with open('test_up.html', 'w') as f:
f.write(content)
t = re.search('<em>\'README', content)
# with open('test_up.html', 'w') as f:
# f.write(content)
t = re.search('<em>README', content)
self.assertIsNotNone(t, 'Logged in but failed to see "<em>\'README"' )
t = re.search(' saved as', content)
self.assertIsNotNone(t, 'Logged in but failed to see "File(s) saved as"' )

View File

@@ -135,7 +135,7 @@ def expowebpage(request, expowebpath, path):
title, = m.groups()
else:
title = ""
m = re.search(r"<meta([^>]*)noedit", head, re.DOTALL + re.IGNORECASE)
m = re.search(r"^<meta([^>]*)noedit", head, re.DOTALL + re.IGNORECASE)
if m:
editable = False
else:
@@ -325,6 +325,4 @@ class ExpoPageForm(forms.Form):
'''The form used by the editexpopage function
'''
title = forms.CharField(widget=forms.TextInput(attrs={'size':'60'}))
#html = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 20}))
html = forms.CharField(widget=forms.Textarea(attrs={"cols":80, "rows":20}))