Skip to content

Commit f005a39

Browse files
author
Matthew Shirtliffe
committed
text sharing with some tests
1 parent f2e1f19 commit f005a39

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

text_sharing/app.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,8 @@
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

1714
class URLForm(FlaskForm):
18-
# url = StringField('url', [is_url])
1915
text = TextAreaField('text')
2016
submit = SubmitField('Submit')
2117

text_sharing/tests/system/app_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)