Re: Blank content from unit testing

2008-10-30 Thread jeffhg58
Here is the pasted code. I am wondering how to verify the content of 
search_form when I initially go to
that url

http://dpaste.com/87795/

-- Original message -- 
From: "Karen Tracey" <[EMAIL PROTECTED]> 
On Thu, Oct 30, 2008 at 11:50 AM, <[EMAIL PROTECTED]> wrote:

But, when I initialling go to '/resultsdb/search_form/' and the request is not 
a get but I a WSGIRequest how to test the content? Because in my view the only 
redirect after a request.GET occurs during an if conditional of when a certain 
button is pressed


I can't parse your question in the first sentence.  Code snippets might help.  
There is no content if you are getting a 302, it is a redirect and the only 
thing you can then examine would be the redirect Location.  Somehow the path 
your code is taking in response to a get on '/resultsdb/search_form/' is 
getting to a point where it returns a redirect, not a response.

You've also got another thread that I hadn't seen when I first responded on 
this one, where someone responded pointing out the likely line in your view you 
are hitting.  I gather from your last sentence you don't believe you can be 
hitting that line, but apparently you are. I couldn't get that far in reading 
the view code because it gets badly mangled in an email interface; dpaste.com 
would be a better place for putting code.

Karen



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Blank content from unit testing

2008-10-30 Thread Karen Tracey
On Thu, Oct 30, 2008 at 11:50 AM, <[EMAIL PROTECTED]> wrote:

> But, when I initialling go to '/resultsdb/search_form/' and the request is
> not a get but I a WSGIRequest how to test the content? Because in my view
> the only redirect after a request.GET occurs during an if conditional of
> when a certain button is pressed
>

I can't parse your question in the first sentence.  Code snippets might
help.  There is no content if you are getting a 302, it is a redirect and
the only thing you can then examine would be the redirect Location.  Somehow
the path your code is taking in response to a get on
'/resultsdb/search_form/' is getting to a point where it returns a redirect,
not a response.

You've also got another thread that I hadn't seen when I first responded on
this one, where someone responded pointing out the likely line in your view
you are hitting.  I gather from your last sentence you don't believe you can
be hitting that line, but apparently you are. I couldn't get that far in
reading the view code because it gets badly mangled in an email interface;
dpaste.com would be a better place for putting code.

Karen

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Blank content from unit testing

2008-10-30 Thread jeffhg58
But, when I initialling go to '/resultsdb/search_form/' and the request is not 
a get but I a WSGIRequest how to test the content? Because in my view the only 
redirect after a request.GET occurs during an if conditional of when a certain 
button is pressed

Jeff
-- Original message -- 
From: "Karen Tracey" <[EMAIL PROTECTED]> 
On Thu, Oct 30, 2008 at 10:25 AM, jeffhg58 <[EMAIL PROTECTED]> wrote:


I am currently the django test client and I have run across a
stumbling block.

When I do a get command for my main screen which is get('/resultsdb/
search_form/'), the status code
returns a 302 with no content.
But, if a do a get on say ('/login/') or a subsequent window besides
the main window such as ('/resultsdb/newresults/') and get a status
code of 200 with the content of the window.

Any help would be greatly appreciated. I am stumped on this.



Well a 302 is a redirect, so it won't have content.  response['Location'] will 
tell you where it is redirecting to, which might give you a hint.


Karen


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Blank content from unit testing

2008-10-30 Thread Karen Tracey
On Thu, Oct 30, 2008 at 10:25 AM, jeffhg58 <[EMAIL PROTECTED]> wrote:

>
> I am currently the django test client and I have run across a
> stumbling block.
>
> When I do a get command for my main screen which is get('/resultsdb/
> search_form/'), the status code
> returns a 302 with no content.
> But, if a do a get on say ('/login/') or a subsequent window besides
> the main window such as ('/resultsdb/newresults/') and get a status
> code of 200 with the content of the window.
>
> Any help would be greatly appreciated. I am stumped on this.
>
>
Well a 302 is a redirect, so it won't have content.  response['Location']
will tell you where it is redirecting to, which might give you a hint.

Karen

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---