summaryrefslogtreecommitdiff
path: root/tests/test_fixture.py
diff options
context:
space:
mode:
authorDaniel Hahler <github@thequod.de>2018-10-30 15:18:38 +0100
committerChris Dent <chris.dent@gmail.com>2018-10-30 14:18:38 +0000
commitc58c1ae23f49c2701ea4ee53d017dd62b1d6f213 (patch)
treeeb3749d48182495419e15b948079311d33b6f5f9 /tests/test_fixture.py
parent455203d2b3b0c898df6d3661cb1de577dfeda483 (diff)
downloadpaste-git-c58c1ae23f49c2701ea4ee53d017dd62b1d6f213.tar.gz
py3 fixes for form handling in paste.fixture (#8)
* py3 fixes for form handling in paste.fixture It uses "not six.PY2" in contrast to other places in the code to be forward-compatible. I've not looked too closely, but it might make sense to decode body/text in the beginning already, instead of having it as bytes internally?! Also, like mentioned in [1] already, it should probably use the correct source encoding?! 1: https://github.com/cdent/paste/blob/36e5b8bd16a6063ec654faf04541f3a20d19f7fe/paste/fixture.py#L820 * Add test, using/fixing SlowConsumer form app
Diffstat (limited to 'tests/test_fixture.py')
-rw-r--r--tests/test_fixture.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/test_fixture.py b/tests/test_fixture.py
index ba56488..f5a659a 100644
--- a/tests/test_fixture.py
+++ b/tests/test_fixture.py
@@ -1,6 +1,7 @@
-from paste.debug.debugapp import SimpleApplication
+from paste.debug.debugapp import SimpleApplication, SlowConsumer
from paste.fixture import TestApp
+
def test_fixture():
app = TestApp(SimpleApplication())
res = app.get('/', params={'a': ['1', '2']})
@@ -26,3 +27,11 @@ def test_fixture():
assert ('one=first' in hc)
assert ('two=second' in hc)
assert ('three=' in hc)
+
+
+def test_fixture_form():
+ app = TestApp(SlowConsumer())
+ res = app.get('/')
+ form = res.forms[0]
+ assert 'file' in form.fields
+ assert form.action == ''