Hi,

My app uses rest framework.
I am writing test cases which involve standard requests like 
GET/POST/DELETE/PUT.
What is the best approach to write the test cases ?

Should I run the web server from unit test in setUp() (by running 'python 
manage.py runserver') so that http
request response can work. That way I can make sure my urls.py is correctly 
setup.

Or is there a better way to achieve the same ?

For now am calling my rest handlers directly by passing request (of type 
HttpRequest()) to it.
The request object is filled with required info which the backend code 
expects.

Since the handlers are called directly am unable to automate tests to make 
sure
urls are working fine.

Please give pointers as to how this can be done.
Thanks in advance.
  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c7145ad6-cc76-4db6-ae1d-0167a5bc4fd5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to