Re: [Django] #30249: Deprecate re-raising view exceptions from test client in tests

2019-03-14 Thread Django
#30249: Deprecate re-raising view exceptions from test client in tests
-+-
 Reporter:  Jon Dufresne |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Jon Dufresne):

 > Some helper would be better yes. `assertResponseException()` or such.

 Yeah, I definitely agree. In my latest revision of the PR, I've added
 `SimpleTestCase.assertRequestRaises(response, expected_exception,
 expected_message)` along with documentation and tests.

 With this in place, tests are now exactly the same size as before:

 {{{
 with self.assertRaises(AttributeError):
 self.client.get(reverse('admin:admin_views_simple_changelist'))
 }}}

 Becomes

 {{{
 response = self.client.get(reverse('admin:admin_views_simple_changelist'))
 self.assertRequestRaises(response, AttributeError)
 }}}

 ---

 I'm open to taking a different approach to triggering the old behavior.
 Ultimately, my goal is to have the test client not skip parts of the
 Django request/response stack by default -- bring `Client` closer to
 acting like a real world HTTP client. If that is through the existing
 setting or a new kwarg, either is fine with me.

 I'll respond to your comments above as they're presented, but again, I'm
 happy to compromise on an alternative path.

 > rather it's using a setting, which has other purposes, to control the
 test-client behaviour.

 Sorry, I'm not sure I follow. This setting is documented as:

 > If set to True, Django’s exception handling of view functions
 (handler500, or the debug view if DEBUG is True) and logging of 500
 responses (django.request) is skipped and exceptions propagate upwards.
 >
 > This can be useful for some test setups.

 IIUC, that is exactly what you're trying to achieve in your tests. That
 is, the 500 handler is skipped and the exception is raised by the caller
 (in this case, a test method).

 > I like and use the current behaviour.

 Yup, I understand. This behavior will continue to be available to those
 that want it by using the existing setting. That isn't going away.

 > Maybe one-day we remove `DEBUG_PROPOGATE_EXCEPTION`, for a custom
 `handler` subclass or such. What do I do then? (For me ) clearly the
 right answer is a flag on `TestClient`, which we already have.

 No one is suggesting `DEBUG_PROPOGATE_EXCEPTION` be removed nor have I
 ever seen such a suggestion outside this ticket. I'm not sure where this
 is coming from.

 ---

 If you still disagree with the overall aim of the ticket, then I'll
 prepare something to discuss further on the mailing list. If you disagree
 only on some of the details, then I think we can work out a compromise
 that fits both our needs.

 Thanks again for the responses and discussion.

-- 
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/067.b7b1f4d33a12a40de32bd915c40ca089%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30172: Incorrect migration applying for new Meta.constraints/indexes and field check/unique or unique/index_together constraints with same fields for postgres

2019-03-14 Thread Django
#30172: Incorrect migration applying for new Meta.constraints/indexes and field
check/unique or unique/index_together constraints with same fields for
postgres
-+-
 Reporter:  Pavel Tyslacki   |Owner:  Pavel
 |  Tyslacki
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  2.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 Tim Graham):

 * severity:  Normal => Release blocker


Comment:

 Marking as a release blocker since it's a bug in a new feature
 (`Meta.constraints`).

-- 
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/063.801daa1a24fac055cc3a57fcd0c657b9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30254: Custom model metaclasses cannot access the attribute dict in __init__

2019-03-14 Thread Django
#30254: Custom model metaclasses cannot access the attribute dict in __init__
-+-
 Reporter:  Matt Westcott|Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  2.2
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
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:"58ad030d05fa50cfed327368ab61defca3303e02" 58ad030d]:
 {{{
 #!CommitTicketReference repository=""
 revision="58ad030d05fa50cfed327368ab61defca3303e02"
 Fixed #30254 -- Allowed model metaclasses to access the attribute dict in
 __init__().

 Regression in a68ea231012434b522ce45c513d84add516afa60.
 }}}

-- 
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/064.957035928b87bde3b8f47b660ef9e020%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30254: Custom model metaclasses cannot access the attribute dict in __init__

2019-03-14 Thread Django
#30254: Custom model metaclasses cannot access the attribute dict in __init__
-+-
 Reporter:  Matt Westcott|Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  2.2
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
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:"985e6c224be0681d7a753b9ded4646024d332bc7" 985e6c22]:
 {{{
 #!CommitTicketReference repository=""
 revision="985e6c224be0681d7a753b9ded4646024d332bc7"
 [2.2.x] Fixed #30254 -- Allowed model metaclasses to access the attribute
 dict in __init__().

 Regression in a68ea231012434b522ce45c513d84add516afa60.

 Backport of 58ad030d05fa50cfed327368ab61defca3303e02 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/064.3217899036e9ee5766e801c5c7d65551%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30254: Custom model metaclasses cannot access the attribute dict in __init__

2019-03-14 Thread Django
#30254: Custom model metaclasses cannot access the attribute dict in __init__
-+-
 Reporter:  Matt Westcott|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  2.2
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * severity:  Normal => Release blocker
 * stage:  Accepted => Ready for checkin


-- 
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/064.afc807f757145097ae34d3f4f84bd37d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30237: admin check for AuthenticationMiddleware should allow subclasses

2019-03-14 Thread Django
#30237: admin check for AuthenticationMiddleware should allow subclasses
-+-
 Reporter:  Alek Ratzloff|Owner:  Herman S
 Type:  Bug  |   Status:  closed
Component:  contrib.admin|  Version:  2.2
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
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:"d8704a4d4f6a3bc96cf26ffd1f14bf4b5c71c74d" d8704a4d]:
 {{{
 #!CommitTicketReference repository=""
 revision="d8704a4d4f6a3bc96cf26ffd1f14bf4b5c71c74d"
 [2.2.x] Fixed #30237 -- Made Authentication/SessionMiddleware and
 ModelBackend admin checks allow subclasses.

 Backport of f976ab1b117574db78d884c94e549a6b8e4c9f9b 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/066.e03289daea2d098ead21266a58ddb739%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30237: admin check for AuthenticationMiddleware should allow subclasses

2019-03-14 Thread Django
#30237: admin check for AuthenticationMiddleware should allow subclasses
-+-
 Reporter:  Alek Ratzloff|Owner:  Herman S
 Type:  Bug  |   Status:  closed
Component:  contrib.admin|  Version:  2.2
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham ):

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


Comment:

 In [changeset:"f976ab1b117574db78d884c94e549a6b8e4c9f9b" f976ab1b]:
 {{{
 #!CommitTicketReference repository=""
 revision="f976ab1b117574db78d884c94e549a6b8e4c9f9b"
 Fixed #30237 -- Made Authentication/SessionMiddleware and ModelBackend
 admin checks allow subclasses.
 }}}

-- 
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/066.ecd9e5f45f319eaaadae8431754b860e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30254: Custom model metaclasses cannot access the attribute dict in __init__

2019-03-14 Thread Django
#30254: Custom model metaclasses cannot access the attribute dict in __init__
-+-
 Reporter:  Matt Westcott|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  2.2
  (models, ORM)  |
 Severity:  Normal   |   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 Simon Charette):

 * stage:  Unreviewed => Accepted


-- 
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/064.0f9cb8c00f2e7cfd4dd84f5701caf3b0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30254: Custom model metaclasses cannot access the attribute dict in __init__

2019-03-14 Thread Django
#30254: Custom model metaclasses cannot access the attribute dict in __init__
-+-
 Reporter:  Matt Westcott|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  2.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Matt Westcott):

 * has_patch:  0 => 1


Comment:

 PR: https://github.com/django/django/pull/11085

-- 
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/064.4f3e9c33f9b5f987837cd70ddd915fc4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30154: i18n: redirects to default login page if LOGIN_URL = 'login' not specified

2019-03-14 Thread Django
#30154: i18n: redirects to default login page if LOGIN_URL = 'login' not 
specified
--+
 Reporter:  Oskar Haller  |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  closed
Component:  Documentation |  Version:  master
 Severity:  Normal|   Resolution:  wontfix
 Keywords:  i18n LOGIN_URL| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by Oskar Haller):

 Created PR https://github.com/django/django/pull/11084

-- 
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/062.77d9035770da6d6e2e4d805f420d0528%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30254: Custom model metaclasses cannot access the attribute dict in __init__

2019-03-14 Thread Django
#30254: Custom model metaclasses cannot access the attribute dict in __init__
-+-
 Reporter:  Matt Westcott|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  2.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * cc: Sergey Fedoseev (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/064.606279ef19d69204970e62a6bb02374e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #30254: Custom model metaclasses cannot access the attribute dict in __init__

2019-03-14 Thread Django
#30254: Custom model metaclasses cannot access the attribute dict in __init__
-+-
   Reporter:  Matt   |  Owner:  nobody
  Westcott   |
   Type:  Bug| Status:  new
  Component:  Database   |Version:  2.2
  layer (models, ORM)|
   Severity:  Normal |   Keywords:
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 In Django <=2.2, it is possible for models to define a custom metaclass
 (as a subclass of `models.base.ModelBase`) and access the attribute dict
 of the class being defined:

 {{{
 from django.db import models


 class PageBase(models.base.ModelBase):
 def __init__(cls, name, bases, dct):
 super(PageBase, cls).__init__(name, bases, dct)
 if 'magic' in dct:
 print("enabling magic on %s" % (name))


 class Page(models.Model, metaclass=PageBase):
 magic = True

 title = models.CharField(max_length=255)
 }}}

 As of commit a68ea231012434b522ce45c513d84add516afa60, this fails because
 all attributes without a `contribute_to_class` method are popped from the
 dict in `ModelBase.__new__` .

 (This pattern is used by Wagtail's Page model
 
https://github.com/wagtail/wagtail/blob/3e1e67021e0a20783ed59e17b43e3c481897fce3/wagtail/core/models.py#L190
 , so this is causing various failures against django stable/2.2.x.)

-- 
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/049.1b706ef25170dce224009a00d4bb45a9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29810: Left outer join using FilteredRelation failed on empty result

2019-03-14 Thread Django
#29810: Left outer join using FilteredRelation failed on empty result
-+-
 Reporter:  Dmitrii Azarenko |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  2.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  ORM  | Triage Stage:  Accepted
  FilteredRelation   |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Can Sarıgöl):

 * needs_better_patch:  1 => 0


Comment:

 I hope the fails are not about me this time :)

-- 
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/064.28398f3b5037ab74408b125295b6de68%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.