Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2024-03-18 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
---+
 Reporter:  Jari Pennanen  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Ülgen Sarıkavak):

 * cc: Ülgen Sarıkavak (added)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e50652c1c-e06810f2-6fd4-447a-a7ac-463394689e41-00%40eu-central-1.amazonses.com.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2020-07-10 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
---+
 Reporter:  Jari Pennanen  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Simon Charette):

 With the introduction of `force_login` in 1.9 I think that the latest
 concerns raised about Loic's patch can be addressed by pointing users are
 using `force_login` if they really want to avoid going through middleware.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.a7b16fb348fdae7ee16a4855edcbfd23%40djangoproject.com.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2014-12-18 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
---+
 Reporter:  Ciantic|Owner:  akaariai
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by timgraham):

 * version:  1.7-beta-2 => master


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.d64b8f0f086f5bbcd00c7590135ed49f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2014-04-28 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
---+--
 Reporter:  Ciantic|Owner:  akaariai
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  1.7-beta-2
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by timo):

 * status:  closed => new
 * has_patch:  1 => 0
 * resolution:  fixed =>
 * severity:  Release blocker => Normal


Comment:

 Reverted from master/1.7 for now and removed release blocker flag.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.963ab3203032b1dfa66a8f19d9fdf832%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2014-04-28 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
---+--
 Reporter:  Ciantic|Owner:  akaariai
 Type:  Bug|   Status:  closed
Component:  Testing framework  |  Version:  1.7-beta-2
 Severity:  Release blocker|   Resolution:  fixed
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Tim Graham ):

 In [changeset:"1d20693fa67f314de08e51af57af6fb5460b7b0c"]:
 {{{
 #!CommitTicketReference repository=""
 revision="1d20693fa67f314de08e51af57af6fb5460b7b0c"
 [1.7.x] Revert "Fixed #15179 -- middlewares not applied for test client
 login()"

 This reverts commit 4fdd51b73240bf9c8d9472fcc45df699f0714755.

 See the ticket for concerns with this implementation; it will be
 revisited.

 Backport of aabceadd7d from master
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.29f17362aaf969d563001667a6173ef3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2014-04-28 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
---+--
 Reporter:  Ciantic|Owner:  akaariai
 Type:  Bug|   Status:  closed
Component:  Testing framework  |  Version:  1.7-beta-2
 Severity:  Release blocker|   Resolution:  fixed
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Tim Graham ):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"aabceadd7d7a61468b0dc7dc9d560a770abae0cf"]:
 {{{
 #!CommitTicketReference repository=""
 revision="aabceadd7d7a61468b0dc7dc9d560a770abae0cf"
 Revert "Fixed #15179 -- middlewares not applied for test client login()"

 This reverts commit 4fdd51b73240bf9c8d9472fcc45df699f0714755.

 See the ticket for concerns with this implementation; it will be
 revisited.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.b541e7fcf4db3168a4f46db7a1da11e5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2014-04-28 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
---+--
 Reporter:  Ciantic|Owner:  akaariai
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  1.7-beta-2
 Severity:  Release blocker|   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by marfire):

 Agreed, I like the approach in Loic's patch. There's still an inherent
 tension here - anything that uses `Client.login()` is going to end up
 inadvertently testing the user's middleware. That seems OK to me, since I
 imagine that any test that uses `Client.login()` is going to end up making
 another request as well, so the middleware will be exercised in either
 case.

 My imagination is limited, however. :-) Given where we are in the cycle
 (and Aymeric's objections), I would lean towards reverting this in 1.7 and
 taking Loic's approach going forward.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.6b42fce92ac0ced1b853a521e24e24f3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2014-04-28 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
---+--
 Reporter:  Ciantic|Owner:  akaariai
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  1.7-beta-2
 Severity:  Release blocker|   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by timo):

 * has_patch:  0 => 1


Comment:

 I like Loic's POC as it obsoletes a lot of the custom code in the
 `Client.login()` and `logout()` methods. My only concern is that there may
 be some subtle differences in behavior that are not tested. Worst case, I
 think we could revert this change in 1.7 and punt it to 1.8.

 What do you think, Kevin?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.4098ba4a35acfd4644c7e3717f03b527%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2014-04-27 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
---+--
 Reporter:  Ciantic|Owner:  akaariai
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  1.7-beta-2
 Severity:  Release blocker|   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by loic84):

 I have a proof of concept, that makes `Client.login()` and `logout()` go
 through a normal request cycle:

 https://github.com/loic/django/compare/ticket15179

 This also unveiled a cache issue with `@override_settings(ROOT_URLCONF)`.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.e44bf2efe74f2d4224b21ea1c8e66d53%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2014-04-26 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
---+--
 Reporter:  Ciantic|Owner:  akaariai
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  1.7-beta-2
 Severity:  Release blocker|   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by aaugustin):

 Given the concerns expressed before committing this patch and the results
 seen during the beta, I would suggest to revert the change. The approach
 seems too fragile. It touches too many layers.

 I would also have closed the ticket as wontfix.

 `Client.login()` is a simple convenience feature. If it doesn't work, it
 isn't hard to write a `LoginMixin` providing a suitable `login` method for
 your website.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.a7f08acf1d147968ecb55f36370f5381%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2014-04-26 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
---+--
 Reporter:  Ciantic|Owner:  akaariai
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  1.7-beta-2
 Severity:  Release blocker|   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by loic84):

 How about taking advantage of https://docs.djangoproject.com/en/dev/ref
 /request-response/#django.http.HttpRequest.urlconf.

 We could set a custom urlconf that contains a login/logout view from
 `contrib.auth` and use these.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.4dbdaa1b0fd44ae12a9ed5a4b30be2b3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2014-04-22 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
---+--
 Reporter:  Ciantic|Owner:  akaariai
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  1.7-beta-2
 Severity:  Release blocker|   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by marfire):

 * cc: k@… (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.119ed296ba9461b023ae630aa9ad252a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2014-04-22 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
---+--
 Reporter:  Ciantic|Owner:  akaariai
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  1.7-beta-2
 Severity:  Release blocker|   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by marfire):

 FWIW this isn't purely theoretical - I came across this after upgrading to
 1.7b1 and getting a huge number of test failures on working code. (As I
 hinted at above, the failures were because I hadn't set up the test
 database to handle a `GET` on '/'.)

 The relevant change is
 
[https://github.com/django/django/commit/4fdd51b73240bf9c8d9472fcc45df699f0714755
 #diff-97160f50594424a40f2621d5a3c581ccL549 here]. The call to `request()`
 does a full request / response cycle. Unfortunately I don't know this area
 of the code well enough to suggest a solution. Is there a way to point the
 code at a dummy view that just returns an `HttpResponse`?

 Even with such a change there will still be some coupling with the other
 (non-authentication) middleware components. That doesn't seem like a
 problem, though, since it's hard to imagine any request-based test working
 if the middleware doesn't work. But if we care we could make this feature
 opt-in with a `use_middleware` keyword argument to `login()`. That would
 minimize coupling and ensure full backward-compatibility.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.e5a330555bd1b896ab72f97754731348%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2014-04-22 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
---+--
 Reporter:  Ciantic|Owner:  akaariai
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  1.7-beta-2
 Severity:  Release blocker|   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by timo):

 * version:  master => 1.7-beta-2


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.47a025e9f8cc6a2405ad5544aa3a8828%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2014-04-22 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
---+
 Reporter:  Ciantic|Owner:  akaariai
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  master
 Severity:  Release blocker|   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by timo):

 * needs_better_patch:  1 => 0
 * has_patch:  1 => 0
 * severity:  Normal => Release blocker
 * stage:  Ready for checkin => Accepted


Comment:

 Seems like it could be a legitimate concern, although I'm not sure how
 often it will be a problem in practice.

 It wasn't initially clear to me where the "real response" was generated; I
 believe that refers to the logic in the `self.request()` calls that were
 added.

 Marking as a release blocker so we make a decision before the 1.7 release.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.e2a5faa49c1fc72f0b67e90103a7bae7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2014-04-19 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
-+-
 Reporter:  Ciantic  |Owner:  akaariai
 Type:  Bug  |   Status:  new
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
Has patch:  1|  checkin
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  1
 |UI/UX:  0
-+-
Changes (by marfire):

 * status:  closed => new
 * needs_better_patch:  0 => 1
 * resolution:  fixed =>


Comment:

 I think there's a serious problem with this approach.

 The "fake" request is used to generate a real response, which means that
 any test that uses `Client.login()` will be coupled to the behavior of an
 arbitrary piece of view code (by default whatever handles a GET of '/').
 So if that view happens to raise an exception, any test that uses
 `Client.login()` will fail. This kind of coupling does not seem like a
 good idea in the test suite (especially considering that such an exception
 needn't even be the result of a bug; it could just be that the test
 database wasn't put in an appropriate state, since that view isn't what's
 being tested).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.6c4f087e347364da6f893caa3af89e9c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2013-11-18 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
-+-
 Reporter:  Ciantic  |Owner:  akaariai
 Type:  Bug  |   Status:  closed
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
Has patch:  1|  checkin
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by Anssi Kääriäinen ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"4fdd51b73240bf9c8d9472fcc45df699f0714755"]:
 {{{
 #!CommitTicketReference repository=""
 revision="4fdd51b73240bf9c8d9472fcc45df699f0714755"
 Fixed #15179 -- middlewares not applied for test client login()

 Requests made with django.test.Client.login() and logout() respect
 defaults defined in django.test.Client instantiation and are processed
 through middleware.

 Thanks to Loic for the reviews.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.e3789a0f8799a9c372994142e22a781c%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2013-11-18 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
-+-
 Reporter:  Ciantic  |Owner:  akaariai
 Type:  Bug  |   Status:  assigned
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
Has patch:  1|  checkin
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by akaariai):

 * owner:  unaizalakain => akaariai


Comment:

 I am going to do some minor final polish & commit this one.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.f5054447f804ed7088557b6866f82aa0%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2013-11-09 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
-+-
 Reporter:  Ciantic  |Owner:
 Type:  Bug  |  unaizalakain
Component:  Testing framework|   Status:  assigned
 Severity:  Normal   |  Version:  master
 Keywords:   |   Resolution:
Has patch:  1| Triage Stage:  Ready for
  Needs tests:  0|  checkin
Easy pickings:  0|  Needs documentation:  0
 |  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by loic84):

 * stage:  Accepted => Ready for checkin


Comment:

 LGTM.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.2282e4a16f0a59025677ccf7c69006a6%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2013-11-09 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
-+-
 Reporter:  Ciantic  |Owner:
 Type:  Bug  |  unaizalakain
Component:  Testing framework|   Status:  assigned
 Severity:  Normal   |  Version:  master
 Keywords:   |   Resolution:
Has patch:  1| Triage Stage:  Accepted
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by unaizalakain):

 Once again, thanks for your review, PR updated ;-)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.f8471bab6124a34491a2323cd0099fdf%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2013-11-07 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
-+-
 Reporter:  Ciantic  |Owner:
 Type:  Bug  |  unaizalakain
Component:  Testing framework|   Status:  assigned
 Severity:  Normal   |  Version:  master
 Keywords:   |   Resolution:
Has patch:  1| Triage Stage:  Accepted
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by unaizalakain):

 Done, thanks for the review!!

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.c5ea817f18692cdbb1a56471486b0cef%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2013-11-07 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
-+-
 Reporter:  Ciantic  |Owner:
 Type:  Bug  |  unaizalakain
Component:  Testing framework|   Status:  assigned
 Severity:  Normal   |  Version:  master
 Keywords:   |   Resolution:
Has patch:  1| Triage Stage:  Accepted
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by loic84):

 As mentioned on the PR, I would rename the newly added `response._request`
 to `response.request_instance` so it's not confusing that there is a
 `response._request` and a `response._request` which are two different
 things.

 FTR: Ideally the old `response.request` would become a getter with a
 deprecation warning that proxies `request_instance.environ`,  or be
 renamed to `request_data`; however making such property would require a
 custom `Response` class which is probably overkill.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.e8e41b7226ef9eb9ccc8a8d52fbf6bff%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2013-11-07 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
-+-
 Reporter:  Ciantic  |Owner:
 Type:  Bug  |  unaizalakain
Component:  Testing framework|   Status:  assigned
 Severity:  Normal   |  Version:  master
 Keywords:   |   Resolution:
Has patch:  1| Triage Stage:  Accepted
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by unaizalakain):

 It's a pity that `username` and `password` kwargs cannot be assumed
 because of the auth backend plugability. Though it would be better not to,
 it seems to me that the only possible solution is to add a `extra` kwarg
 that accepts a dict although I don't know if it's a really needed feature
 (though it doesn't really hurt to have it) because of the possibility of
 setting custom env vars directly at the `Client` at instantiation or
 modifying `Client.defaults`.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.c60333b1a6056f4c001c09aabd0aaa36%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2013-11-07 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
-+-
 Reporter:  Ciantic  |Owner:
 Type:  Bug  |  unaizalakain
Component:  Testing framework|   Status:  assigned
 Severity:  Normal   |  Version:  master
 Keywords:   |   Resolution:
Has patch:  1| Triage Stage:  Accepted
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by loic84):

 @unaizalakain, true for `self.request` ultimately being called.

 The issue with the request environ remains though, what do you think?

 It's worth noting that `login` already uses the `**kwargs` wildcard for
 `**credentials`, so it can't be used for `**extra`, IMO not a big deal if
 `login` and `logout` are not exactly consistent with the other methods as
 they operate at a higher level.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.511730e88206bcf2c4fd1488a00a832a%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2013-11-07 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
-+-
 Reporter:  Ciantic  |Owner:
 Type:  Bug  |  unaizalakain
Component:  Testing framework|   Status:  assigned
 Severity:  Normal   |  Version:  master
 Keywords:   |   Resolution:
Has patch:  1| Triage Stage:  Accepted
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by unaizalakain):

 Yep, tests run smoothly, so `self.request()._request` instead of
 `self.handler(self._base_environ)._request` ;-)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.71d1f3eafedec094933937b4e29909b1%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2013-11-07 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
-+-
 Reporter:  Ciantic  |Owner:
 Type:  Bug  |  unaizalakain
Component:  Testing framework|   Status:  assigned
 Severity:  Normal   |  Version:  master
 Keywords:   |   Resolution:
Has patch:  1| Triage Stage:  Accepted
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by unaizalakain):

 It's kind of messy but all the `get`, `post`, etc. go through middleware.

 This methods all call the `self.generic` method which in turn calls the
 `self.request` method. Now, this method doesn't do a big thing in
 `RequestFactory` but it's subclassed in `Client` and makes use of
 `self.handler` which builds the request through middleware.

 Now, the `self.request` returns directly a response and in `login` and
 `logout` we need the source request also. I thought about returning
 `(request, response)` tuples in `self.request` but that wouldn't be
 backwards compatible so I directly call `self.handler` witch returns me
 the source request attached.

 Now that I think it, if `self.handler` attaches the source request, I
 could also get it (I think) through `self.request`. Gonna look into it.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.976ea4804f2c90254a04df8e155f8d71%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2013-11-07 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
-+-
 Reporter:  Ciantic  |Owner:
 Type:  Bug  |  unaizalakain
Component:  Testing framework|   Status:  assigned
 Severity:  Normal   |  Version:  master
 Keywords:   |   Resolution:
Has patch:  1| Triage Stage:  Accepted
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by loic84):

 I'm not too sure about this ticket.

 `login` and `logout` would be the only requests that go through
 middleware. (refs. #9159)

 Also going through the middleware is not necessarily sufficient to be
 useful, what if it the middleware tests for the HTTP verb (hardcoded to
 `GET` currently)? or for a specific IP address (hardcoded to '127.0.0.1')
 or even for a specific endpoint (hardcoded to '/'). For this to work,
 `login` and `logout` should accept `**extra` argument like the other
 methods.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.475c685b20165686c5a2c5cb0739ba1e%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2013-10-29 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
-+-
 Reporter:  Ciantic  |Owner:
 Type:  Bug  |  unaizalakain
Component:  Testing framework|   Status:  assigned
 Severity:  Normal   |  Version:  master
 Keywords:   |   Resolution:
Has patch:  1| Triage Stage:  Accepted
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by unaizalakain):

 * has_patch:  0 => 1


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.5de3ec37db7aa9937cd65398fd3ba1e6%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2013-10-29 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
-+-
 Reporter:  Ciantic  |Owner:
 Type:  Bug  |  unaizalakain
Component:  Testing framework|   Status:  assigned
 Severity:  Normal   |  Version:  master
 Keywords:   |   Resolution:
Has patch:  0| Triage Stage:  Accepted
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by unaizalakain):

 PR sent: https://github.com/django/django/pull/1824

 Requests made with `django.test.Client.login` and
 `django.test.Client.logout` respect defaults defined in
 `django.test.Client`
 instantiation and are processed through middleware now.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.6655ab3f1d983e764a4543b3c5e692e6%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2013-10-29 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
-+-
 Reporter:  Ciantic  |Owner:
 Type:  Bug  |  unaizalakain
Component:  Testing framework|   Status:  assigned
 Severity:  Normal   |  Version:  master
 Keywords:   |   Resolution:
Has patch:  0| Triage Stage:  Accepted
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by unaizalakain):

 * status:  new => assigned
 * needs_better_patch:  1 => 0
 * has_patch:  1 => 0
 * owner:  nobody => unaizalakain


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.c291e07a81caca78ce2733f845361337%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2013-04-17 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
---+
 Reporter:  Ciantic|Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+

Comment (by tim.dawborn):

 #20275 is another duplicate. Any chance of bumping this?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2012-11-07 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
---+
 Reporter:  Ciantic|Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+
Changes (by mitar):

 * cc: mmitar@… (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2012-11-06 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
---+
 Reporter:  Ciantic|Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+

Comment (by claudep):

 #18973 was a duplicate with another use case.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2011-01-29 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
-+--
   Reporter:  Ciantic| Owner:  nobody
 Status:  new| Milestone:  1.3   
  Component:  Testing framework  |   Version:  SVN   
 Resolution: |  Keywords:
   Triage Stage:  Accepted   | Has patch:  1 
Needs documentation:  0  |   Needs tests:  0 
Patch needs improvement:  1  |  
-+--
Changes (by russellm):

  * needs_better_patch:  0 => 1
  * needs_tests:  1 => 0
  * stage:  Unreviewed => Accepted


Comment:

 Accepting the use case. However, the patch needs some work.

  * The patch should note that the reference to "/login" is arbitrary --
 it's not actually using /login, it's just using that URL as a dummy
 location.
  * The test case isn't particularly good - it's checking a test condition
 that is a composite of multiple features. You should be checking that
 request has an attribute called "middlewares", and that the value is
 "+middlewares'. Checking a comparison of concatenated strings is just
 confusing the issue.
  * The test case should be integrated with Django's test suite (the
 test_client_regress tests would be a good location).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2011-01-27 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
+---
  Reporter:  Ciantic| Owner:  nobody
Status:  new| Milestone:  1.3   
 Component:  Testing framework  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Unreviewed | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  1 
Needs_better_patch:  0  |  
+---
Comment (by Ciantic):

 My patch apparently fixes the ''second'' problem (which I mentioned in
 first comment), but the actual problem that middlewares are not run is not
 yet fixed. I'm working on that right now.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2011-01-27 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
+---
  Reporter:  Ciantic| Owner:  nobody
Status:  new| Milestone:  1.3   
 Component:  Testing framework  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Unreviewed | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  1 
Needs_better_patch:  0  |  
+---
Changes (by Ciantic):

  * has_patch:  0 => 1
  * needs_tests:  0 => 1
  * milestone:  => 1.3

Comment:

 Sweet, I found (technically) a one line patch. The comment I put there is
 required since it is not obvious why one could not use `super(Client,
 self).get("/login/")`

 Do we need tests for this? Disclaimer I have not run full django suite
 tests yet (since I forgot again how it is ran), but I'm hopeful.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2011-01-27 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
+---
  Reporter:  Ciantic| Owner:  nobody
Status:  new| Milestone:
 Component:  Testing framework  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by Ciantic):

 Here is a little unit test where `Client.get()` test (test_client_request)
 works, but `Client.login()` (test_client_login) fails:

 {{{
 from django.conf.urls.defaults import * #@UnusedWildImport
 from django.contrib.auth.models import User
 from django.http import HttpResponse
 from django.test import TestCase, Client
 from django.contrib.auth.signals import user_logged_in
 from django.dispatch import receiver

 urlpatterns = patterns('',
 (r'^$', 'testing.tests.http_host_view'),
 )

 def http_host_view(request):
 return HttpResponse(request.get_host())

 class DjangoClientRequestTests(TestCase):
 urls = 'testing.tests'

 def setUp(self):
 u = User.objects.create(username='tester')
 u.set_password('1234')
 u.save()

 def test_client_request(self):
 c = Client(enforce_csrf_checks=False, HTTP_HOST='myhost.com')
 self.assertEqual(c.get("/").content, 'myhost.com')

 def test_client_login(self):
 c = Client(enforce_csrf_checks=False, HTTP_HOST='myhost.com')

 @receiver(user_logged_in)
 def login(sender, signal, request, user):
 self.assertEqual(request.get_host(), 'myhost.com') #
 <-- This fails!

 c.login(username='tester', password='1234')
 }}}

 This is probably a good way to start figuring out a patch for
 `Client.login()`.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15179: django.test.client.Client.login fake HttpRequest is not run through middlewares

2011-01-27 Thread Django
#15179: django.test.client.Client.login fake HttpRequest is not run through
middlewares
+---
  Reporter:  Ciantic| Owner:  nobody
Status:  new| Milestone:
 Component:  Testing framework  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by Ciantic):

  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 I'm too hasty here, sorry.

 Apparently I ''also'' need to be able to define
 `request.META['HTTP_HOST']` to the fake request in
 `django.test.client.Client.login`. Since per site login is required to be
 verified against Host of the request.

 So maybe making the `Client.login()` use more parameters? Like the
 `Client.get()` where one can define the `HTTP_HOST` of the request object
 etc. Naturally there has to be a backwards compatible way to run
 `Client.login()`, maybe even different named method?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.