My Django application interrupts and imports data from another HTML application. I tested every parsing function and would like to test a scanner that will go through another application. After that, I would like to do some integration tests. To make the tests as simple as possible, I want to mock the imported web application by creating a small web application that runs some hard HTML code and has all the paths I'm going to go through.
EDIT . In addition, my layout should have a little dynamic behavior - for example, to test failed and successful logins. Therefore, I can not provide only static files.
How would you create such a mock application? Subclass BaseHTTPServer
? CGI? Use some structure (like twill using Quixote)? Or would it be wise to use Django for this? This is the solution I come up with for use, but Django seems too complicated for such a problem; OTOH, another structure will be too heavy a dependency for such a small need, and BaseHTTPServer
just too useful to use.
2nd EDIT : I'm not interested in mocking classes, queries, etc. This is not the approach that I want to use, and the proposal to use this approach is not an answer to me (although I am grateful to the nice people who have kindly offered me this so far). If it's hard for me to think about my question, just forget what I said about tests - how would you roughly simulate a web application using Python in general?
source share