Re: [Django] #17011: Recursion error in TestCase class decorated by override_settings when overriding method on parent class and calling parent method

2011-10-09 Thread Django
#17011: Recursion error in TestCase class decorated by override_settings when
overriding method on parent class and calling parent method
---+
 Reporter:  jsdalton   |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  Testing framework  |  Version:  SVN
 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 loewis):

 In [16950]:
 {{{
 #!CommitTicketReference repository="" revision="16950"
 Merged revisions
 
16743,16745,16747-16750,16752-16754,16756-16760,16770,16773-16800,16802-16804,16806,16808,16811,16813,16815,16817-16826,16829-16833,16835-16836,16838-16843,16845-16858,16860-16866,16868,16871-16877,16882-16890,16893-16947
 via svnmerge from
 https://code.djangoproject.com/svn/django/trunk

 
   r16743 | gabrielhurley | 2011-09-09 23:36:58 +0200 (Fr, 09 Sep 2011) | 2
 lines

   Fixed #16791 -- Updated a broken URL in the README file. Thanks to
 paulcwatts for the report and patch.
 
   r16745 | Alex | 2011-09-09 23:45:58 +0200 (Fr, 09 Sep 2011) | 1 line

   Switch to using explicit new-style division behavior, rather than
 relying on teh classic behavior.
 
   r16747 | SmileyChris | 2011-09-10 00:32:38 +0200 (Sa, 10 Sep 2011) | 1
 line

   Fix and test for cleaning a non-string value in a URLField
 
   r16748 | gabrielhurley | 2011-09-10 00:33:28 +0200 (Sa, 10 Sep 2011) | 2
 lines

   Fixed #16786 -- Minor cleanups in the memcached section of the caching
 topic guide. Thanks to jamesp for the report and patch.
 
   r16749 | jbronn | 2011-09-10 00:34:23 +0200 (Sa, 10 Sep 2011) | 1 line

   Fixed #16408 -- Fixed conversion of dates, and other problems with the
 SpatiaLite backend.
 
   r16750 | jbronn | 2011-09-10 00:47:18 +0200 (Sa, 10 Sep 2011) | 1 line

   Removed extra call to `syncdb` that slipped in with r16749.
 
   r16752 | SmileyChris | 2011-09-10 00:57:12 +0200 (Sa, 10 Sep 2011) | 1
 line

   Fixes #16664 -- URLField's to_python method fails with ValueError on
 some urls on python 2.7. Based on patch by zigzag.
 
   r16753 | russellm | 2011-09-10 01:02:33 +0200 (Sa, 10 Sep 2011) | 1 line

   Added two pointless query repeats to work around a known issue with
 MySQL that was causing failures in our test suite.
 
   r16754 | gabrielhurley | 2011-09-10 01:25:48 +0200 (Sa, 10 Sep 2011) | 2
 lines

   Fixed #16782 -- Corrected a broken cross-reference to the database
 engine setting in the tutorial. Thanks to mjumbewu for the report and
 patch.
 
   r16756 | kmtracey | 2011-09-10 02:05:48 +0200 (Sa, 10 Sep 2011) | 2
 lines

   Fixed #15722: ensure formsets evaluate to True even if they have no
 forms. Thanks mlavin.
 
   r16757 | jbronn | 2011-09-10 02:29:34 +0200 (Sa, 10 Sep 2011) | 1 line

   Fixed #13670 -- Comparisons with the spatial adapter won't blow up in
 some corner cases.  Thanks, milosu for the bug report and jpaulett for the
 patch.
 
   r16758 | russellm | 2011-09-10 02:46:38 +0200 (Sa, 10 Sep 2011) | 1 line

   Added protection against spoofing of X_FORWARDED_HOST headers. A
 security announcement will be made shortly.
 
   r16759 | russellm | 2011-09-10 02:46:48 +0200 (Sa, 10 Sep 2011) | 1 line

   Corrected an issue which could allow attackers to manipulate session
 data using the cache. A security announcement will be made shortly.
 
   r16760 | russellm | 2011-09-10 02:47:00 +0200 (Sa, 10 Sep 2011) | 1 line

   Altered the behavior of URLField to avoid a potential DOS vector, and to
 avoid potential leakage of local filesystem data. A security announcement
 will be made shortly.
 
   r16770 | Alex | 2011-09-10 03:53:56 +0200 (Sa, 10 Sep 2011) | 1 line

   Make ``Formset.__getitem__`` O(1), rather than O(n).  If you override
 ``__iter__`` you now need to also override ``__getitem__`` for consistant
 behavior.  Thanks to Carl and Russ for the review.
 
   r16773 | Alex | 2011-09-10 04:42:05 +0200 (Sa, 10 Sep 2011) | 1 line

   Fixed #11404.  Added ``FormSet.has_changed``, for consistancy with
 ``Form.has_changed``. Thanks to michelts for the patch.
 
   r16774 | Alex | 2011-09-10 04:52:37 +0200 (Sa, 10 Sep 2011) | 1 line

   Fixed #16793. Added more cross referencing to the load tag's
 documentation.  Thanks to bluejeansummer for the patch.
 
   r16775 | jbronn | 2011-09-10 05:04:30 +0200 (Sa, 10 Sep 2011) | 1 line

   Fixed #16790 -- Modified the geographic admin to work after r16594.
 Thanks, jdiego, for the 

Re: [Django] #17011: Recursion error in TestCase class decorated by override_settings when overriding method on parent class and calling parent method

2011-10-08 Thread Django
#17011: Recursion error in TestCase class decorated by override_settings when
overriding method on parent class and calling parent method
---+
 Reporter:  jsdalton   |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  Testing framework  |  Version:  SVN
 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 carljm):

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


Comment:

 In [16942]:
 {{{
 #!CommitTicketReference repository="" revision="16942"
 Fixed #17011 - Made override_settings modify a decorated class in-place
 rather than creating a dynamic subclass, so as to avoid infinite recursion
 when used with super(). Thanks jsdalton for the report and patch.
 }}}

-- 
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] #17011: Recursion error in TestCase class decorated by override_settings when overriding method on parent class and calling parent method

2011-10-08 Thread Django
#17011: Recursion error in TestCase class decorated by override_settings when
overriding method on parent class and calling parent method
---+
 Reporter:  jsdalton   |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  SVN
 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 carljm):

 * severity:  Normal => Release blocker


Comment:

 This is a release blocker, as its a major issue with a new feature in 1.4.

-- 
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] #17011: Recursion error in TestCase class decorated by override_settings when overriding method on parent class and calling parent method

2011-10-07 Thread Django
#17011: Recursion error in TestCase class decorated by override_settings when
overriding method on parent class and calling parent method
---+
 Reporter:  jsdalton   |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  SVN
 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 jsdalton):

 * needs_better_patch:  1 => 0


Comment:

 Ah, dang, thanks. Looks like there were some issues in multiple
 inheritance scenarios, particularly where @override_settings was being
 applied to more than one class in the inheritance chain (e.g. the test
 class `staticfiles_tests.TestCollectionNonLocalStorage`). Shame on me for
 not running the full test suite with my first patch.

 Anyhow, the resolution is pretty straightforward: assigning the original
 pre-setup/post-teardown methods to local variables instead of class
 attributes, so they don't end up stepping on each others toes.

 I've updated my topic branch with the new commits, which is now reflected
 in the pull request. Full test suite now passes.

-- 
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] #17011: Recursion error in TestCase class decorated by override_settings when overriding method on parent class and calling parent method

2011-10-07 Thread Django
#17011: Recursion error in TestCase class decorated by override_settings when
overriding method on parent class and calling parent method
---+
 Reporter:  jsdalton   |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  SVN
 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 carljm):

 * needs_better_patch:  0 => 1


Comment:

 Replying to [comment:3 jsdalton]:
 > Thanks Carl. I think you are correct, monkey patching in this case is
 cleaner and less prone to weirdness. I moved the the tests I had created
 to `settings_tests` and worked the implementation. `settings_tests` all
 pass.
 >
 > I filed the patch as a pull request, hopefully I'm doing this right:
 >
 > https://github.com/django/django/pull/60

 Thanks for the patch! The pull request part is right, but something about
 the patch isn't; when I apply the patch and run the full test suite I get
 hundreds of infinite recursion errors. I haven't tracked down the cause.

-- 
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] #17011: Recursion error in TestCase class decorated by override_settings when overriding method on parent class and calling parent method

2011-10-07 Thread Django
#17011: Recursion error in TestCase class decorated by override_settings when
overriding method on parent class and calling parent method
---+
 Reporter:  jsdalton   |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  SVN
 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 jsdalton):

 * needs_better_patch:  1 => 0


Comment:

 Thanks Carl. I think you are correct, monkey patching in this case is
 cleaner and less prone to weirdness. I moved the the tests I had created
 to `settings_tests` and worked the implementation. `settings_tests` all
 pass.

 I filed the patch as a pull request, hopefully I'm doing this right:

 https://github.com/django/django/pull/60

-- 
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] #17011: Recursion error in TestCase class decorated by override_settings when overriding method on parent class and calling parent method

2011-10-06 Thread Django
#17011: Recursion error in TestCase class decorated by override_settings when
overriding method on parent class and calling parent method
---+
 Reporter:  jsdalton   |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  SVN
 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 carljm):

 * stage:  Unreviewed => Accepted


Comment:

 This is because of the dynamic-subclass-creation magic that the decorator
 does. Basically, the problem is that there doesn't seem to be any way to
 write a Python class decorator that doesn't break weirdly in some cases
 (c.f. the recent threads about decorating class-based views on the
 -developers mailing list).

 I think in this case the decorator probably ought to just modify the given
 class in-place (monkeypatch it) rather than creating a dynamic subclass.
 Because I think the subclassing/super case you've demonstrated is much
 more common usage than someone trying to do this:

 {{{
 class Foo(TestCase):
 ...

 Bar = override_settings(SOMETHING="value")(Foo)
 }}}

 Which is the case where monkeypatching fails (because both Foo and Bar end
 up modified).

 I guess it's possible someone might try that, but we could just tell them
 to do this instead:

 {{{
 class Foo(TestCase):
 ...

 @override_settings(SOMETHING="value")
 class Bar(Foo):
 pass
 }}}

 I am not aware of any perfect option here; I think in this case
 monkeypatching would fail less often than what we do currently.

-- 
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] #17011: Recursion error in TestCase class decorated by override_settings when overriding method on parent class and calling parent method

2011-10-06 Thread Django
#17011: Recursion error in TestCase class decorated by override_settings when
overriding method on parent class and calling parent method
---+--
 Reporter:  jsdalton   |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  SVN
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by jsdalton):

 * cc: jim.dalton@… (added)
 * needs_better_patch:   => 1
 * has_patch:  0 => 1
 * needs_tests:   => 0
 * needs_docs:   => 0


-- 
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.



[Django] #17011: Recursion error in TestCase class decorated by override_settings when overriding method on parent class and calling parent method

2011-10-06 Thread Django
#17011: Recursion error in TestCase class decorated by override_settings when
overriding method on parent class and calling parent method
---+
 Reporter:  jsdalton   |  Owner:  nobody
 Type:  Bug| Status:  new
Component:  Testing framework  |Version:  SVN
 Severity:  Normal |   Keywords:
 Triage Stage:  Unreviewed |  Has patch:  0
Easy pickings:  0  |  UI/UX:  0
---+
 A bit hard to explain but a fairly straightforward bug. Basically, if you
 have a sub class of TestCase and then a sub class of that sub class that's
 decorated by @override_settings at the class level, and you override a
 method and then call the parent method, you get a recursion error.

 Kind of easier to demonstrate in code:


 {{{
 from django.test import TestCase
 from django.test.utils import override_settings

 class FooTests(TestCase):
   def setUp(self):
 # do some stuff
 pass

 @override_settings(FOO='bar')
 class SubFooTests(TestCase):
   def setUp(self):
 # recursion error!
 super(SubFooTests, self).setUp()
 }}}

 I have a patch with a regression test that formally demonstrates this
 behavior but have not investigated it yet. It's possible it's related to
 #16224, but I don't really know.

-- 
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.