On Thu, Sep 2, 2010 at 4:33 PM, Daniel Roseman <daniel@roseman.org.uk> wrote:
On Sep 2, 9:49 am, girish shabadimath <girishmss.1...@gmail.com>
wrote:
> actually i wanted to access values from database and use those values in urlHave you read the extensive documentation on how to make a query
> unittesting,,,
>
> like:
> response = self.client.get('def/defect/', {'*ID*':*id*})
> self.failUnlessEqual(response.status_code, 200)
>
> how to get id from database..?,,,and also i want this test to be done for
> each id in database,,hw to proceed..?
>
> ,,,this may sound silly but plz help..!!!!
against the database?
http://docs.djangoproject.com/en/1.2/topics/db/queries/
However, I must say that it seems very odd to want to test requesting
a URL against every ID in the database. That's not how unit testing
works. Test with a representative sample of data, that's what fixtures
are for.
--
DR.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
--
Girish M S
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment