File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change 1010# export FLASK_APP=app.py
1111# flask run
1212
13- # def is_url(form, field):
14- # if not field.data.startswith('https://'):
15- # raise validators.ValidationError('A valid url is required')
1613
1714class URLForm (FlaskForm ):
18- # url = StringField('url', [is_url])
1915 text = TextAreaField ('text' )
2016 submit = SubmitField ('Submit' )
2117
Original file line number Diff line number Diff line change @@ -26,9 +26,9 @@ def test_home(self):
2626 with self .app as client :
2727 response = client .get ('/' )
2828 self .assertEqual (response .status_code , 200 )
29- self .assertIn ('<h1>Enter URL </h1>' , response .get_data ().decode ("utf-8" ) )
29+ self .assertIn ('<h1>Enter Text </h1>' , response .get_data ().decode ("utf-8" ) )
3030
31- def test_create_url (self ):
31+ def test_create_text (self ):
3232 with self .app as client :
33- response = client .post ('/' , data = {'url ' : 'https://matthewshirtliffe.co.uk/ ' }, follow_redirects = False )
33+ response = client .post ('/' , data = {'text ' : 'Some text ' }, follow_redirects = False )
3434 self .assertEqual (response .status_code , 302 )
You can’t perform that action at this time.
0 commit comments