Commit 1afdf97
committed
Update test/test_actions.py to work with py.test
The test_actions tests use a FieldStorage object to mock form
submissions. FieldStorage would usually use the 'QUERY_STRING'
environment variable to populate the initial list of MiniFieldStorage
values stored within the FieldStorage object, but because there is no
'QUERY_STRING' environment variable when running the test from the
commandline it tries to parse sys.argv instead. If any py.test options
are used (ie. '--tb=short') then they may end up in the MiniFieldStorage
list causing some tests to fail because they were not expecting the
extra MiniFieldStorage values.
To fix this we explicitly pass an dict with an empty 'QUERY_STRING'
value as the FieldStorage environ argument to ensure that the initial
MiniFieldStorage list is empty.1 parent df3893a commit 1afdf97
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
0 commit comments