kevinsl / wsgi-intercept

Automatically exported from code.google.com/p/wsgi-intercept
Other
0 stars 0 forks source link

empty generator (WSGI app) is not detected properly #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm not sure exactly how this problem was encountered but the details are here:
http://www.kds.com.ua/wp/2007/06/04/testing-django-with-twill-and-nosetests/

[snip]
...Now have a pleasure of not starting django development webserver, nor
using apache to do http-level tests in my project.

Thanks to twill and its wsgi integration.

Works smoothly now, but caused me little cursing when twill refused to see
rss feed.

After digging the twill code I’ve changed a single line - still don’t know
how correct is this:

---
/usr/lib/python2.4/site-packages/twill-0.9b1-py2.4.egg/twill/wsgi_intercept.py.o
rig
2007-06-04 21:10:37 +0300
+++
/usr/lib/python2.4/site-packages/twill-0.9b1-py2.4.egg/twill/wsgi_intercept.py
     2007-06-04 21:10:45 +0300
@@ -265,7 +265,7 @@
                 for data in self.write_results:
                     self.output.write(data)

-            if generator_data:
+            if generator_data is not None:
                 self.output.write(generator_data)
                 for data in self.result:
                     self.output.write(data)

Nevertheless it didn’t break anything and I have a luxury to test rss feeds
too:
...
[snip]

This was committed as revision 3 here but wanted to make this ticket for
safe keeping.  Unfortunately, I couldn't come up with a regression test for
the fix since I don't really understand the problem that well.

Original issue reported on code.google.com by kumar.mcmillan on 4 Dec 2007 at 8:30

GoogleCodeExporter commented 8 years ago

Original comment by kumar.mcmillan on 4 Dec 2007 at 8:30