Re: [Django] #18417: override_settings doesn't work with unittest.TestCase subclasses

2012-11-25 Thread Django
#18417: override_settings doesn't work with unittest.TestCase subclasses
-+-
 Reporter:  claudep  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Testing framework|  Version:  1.4
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Design
Has patch:  1|  decision needed
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by Claude Paroz ):

 In [changeset:"4389b51fabf6d5d98d3d59681a527e0b4fbe4331"]:
 {{{
 #!CommitTicketReference repository=""
 revision="4389b51fabf6d5d98d3d59681a527e0b4fbe4331"
 [1.5.x] Fixed #18417 -- Raised exception when unittest.TestCase is
 decorated with override_settings

 Backport of 9f7cefd5 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 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] #18417: override_settings doesn't work with unittest.TestCase subclasses

2012-11-25 Thread Django
#18417: override_settings doesn't work with unittest.TestCase subclasses
-+-
 Reporter:  claudep  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Testing framework|  Version:  1.4
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Design
Has patch:  1|  decision needed
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by Claude Paroz ):

 In [changeset:"6945f60c2b2406ba06d889020d50aaba80e7d317"]:
 {{{
 #!CommitTicketReference repository=""
 revision="6945f60c2b2406ba06d889020d50aaba80e7d317"
 [1.5.x] Enabled SimpleTestCase to be decorated by override_settings

 Refs #18417. Also fixed some test case classes which subclassed
 the wrong parent.
 Backport of a5d47415f 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 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] #18417: override_settings doesn't work with unittest.TestCase subclasses

2012-11-25 Thread Django
#18417: override_settings doesn't work with unittest.TestCase subclasses
-+-
 Reporter:  claudep  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Testing framework|  Version:  1.4
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Design
Has patch:  1|  decision needed
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by Claude Paroz ):

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


Comment:

 In [changeset:"9f7cefd5059e78d75f1e1a852b51a6286ecec728"]:
 {{{
 #!CommitTicketReference repository=""
 revision="9f7cefd5059e78d75f1e1a852b51a6286ecec728"
 Fixed #18417 -- Raised exception when unittest.TestCase is decorated with
 override_settings
 }}}

-- 
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] #18417: override_settings doesn't work with unittest.TestCase subclasses

2012-11-25 Thread Django
#18417: override_settings doesn't work with unittest.TestCase subclasses
-+-
 Reporter:  claudep  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Testing framework|  Version:  1.4
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Design
Has patch:  1|  decision needed
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by Claude Paroz ):

 In [changeset:"a5d47415f47025b014e580af1533e9023dc32945"]:
 {{{
 #!CommitTicketReference repository=""
 revision="a5d47415f47025b014e580af1533e9023dc32945"
 Enabled SimpleTestCase to be decorated by override_settings

 Refs #18417. Also fixed some test case classes which subclassed
 the wrong parent.
 }}}

-- 
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] #18417: override_settings doesn't work with unittest.TestCase subclasses

2012-10-26 Thread Django
#18417: override_settings doesn't work with unittest.TestCase subclasses
-+-
 Reporter:  claudep  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Testing framework|  Version:  1.4
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Design
Has patch:  1|  decision needed
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by claudep):

 The attached patch raises an exception if the decorated class is not a
 subclass of SimpleTestCase. Note that currently this works only for
 TransactionTestCase, but the current documentation tells that
 SimpleTestCase can be decorated by override_settings (and I also think it
 should)
 
(https://docs.djangoproject.com/en/dev/topics/testing/#django.test.SimpleTestCase).

-- 
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] #18417: override_settings doesn't work with unittest.TestCase subclasses

2012-10-21 Thread Django
#18417: override_settings doesn't work with unittest.TestCase subclasses
-+-
 Reporter:  claudep  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Testing framework|  Version:  1.4
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Design
Has patch:  1|  decision needed
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by aaugustin):

 Replying to [comment:3 claudep]:
 > Replying to [comment:2 aaugustin]:
 > > `override_settings` is Django-specific; I believe it's fair to
 restrict it to subclasses of `django.test.TransactionTestCase` or
 `TestCase`, provided an exception is raised when it's misused.
 >
 > I don't follow you here. There are clearly use-cases currently in our
 test suite that would need override_settings for `unittest.TestCase`. It
 does not appear so unnatural to me.

 Right -- `unittest.TestCase` is sometimes preferred because it's faster.

 The current practice in Django's test suite is to use
 `django.test.(Transaction)TestCase` when the test cases requires some
 Django-specific behavior (fixtures, test client, etc.) and
 `unittest.TestCase` when it doesn't.

 Since `override_settings` is Django-specific, I suggest switching test
 cases decorated with `@override_settings` to
 `django.test.(Transaction)TestCase`.

 If `override_settings` raises an exception for unsupported classes, we'll
 immediately know which ones need this change.

-- 
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] #18417: override_settings doesn't work with unittest.TestCase subclasses

2012-10-21 Thread Django
#18417: override_settings doesn't work with unittest.TestCase subclasses
-+-
 Reporter:  claudep  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Testing framework|  Version:  1.4
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Design
Has patch:  1|  decision needed
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by claudep):

 Replying to [comment:2 aaugustin]:
 > `override_settings` is Django-specific; I believe it's fair to restrict
 it to subclasses of `django.test.TransactionTestCase` or `TestCase`,
 provided an exception is raised when it's misused.

 I don't follow you here. There are clearly use-cases currently in our test
 suite that would need override_settings for `unittest.TestCase`. It does
 not appear so unnatural to me.

 > > Currently, `override_settings` guarantees that the settings are reset
 before each test in the test case. Altering them in a test won't affect
 other tests. This isn't documented but it's likely that some people are
 relying on this behavior.

 That's right, and that's why I didn't commit it until now.

 (...)

 > In my eyes this is as a choice between:
 > - raising an exception for people who've written tests that never ran;
 and
 > - taking the risk to introduce unexpected test failures for people
 who've written working tests.
 >
 > I'm +1 on the first option and -0 on the second.

 There might be a third option, use `_pre_setup/_post_teardown` for Django
 test subclasses, and `setUpClass/tearDownClass` for `unittest.TestCase`
 subclasses. It's a bit peculiar to have different behaviours depending on
 the test class, but at least compatibility is kept, and we can document
 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 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] #18417: override_settings doesn't work with unittest.TestCase subclasses

2012-10-21 Thread Django
#18417: override_settings doesn't work with unittest.TestCase subclasses
-+-
 Reporter:  claudep  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Testing framework|  Version:  1.4
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Design
Has patch:  1|  decision needed
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by aaugustin):

 * stage:  Ready for checkin => Design decision needed


Comment:

 `override_settings` is Django-specific; I believe it's fair to restrict it
 to subclasses of `django.test.TransactionTestCase` or `TestCase`, provided
 an exception is raised when it's misused.

 Currently, `override_settings` guarantees that the settings are reset
 before each test in the test case. Altering them in a test won't affect
 other tests. This isn't documented but it's likely that some people are
 relying on this behavior.

 So the current patch will lead to test failures for some users after
 upgrading Django. These test failures won't happen if the failing test is
 run in isolation, making them hard to track down.

 In my eyes this is as a choice between:
 - raising an exception for people who've written tests that never ran; and
 - taking the risk to introduce unexpected test failures for people who've
 written working tests.

 I'm +1 on the first option and -0 on the second.

-- 
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] #18417: override_settings doesn't work with unittest.TestCase subclasses

2012-06-08 Thread Django
#18417: override_settings doesn't work with unittest.TestCase subclasses
-+-
 Reporter:  claudep  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Testing framework|  Version:  1.4
 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 ethlinn):

 * cc: asendecka@… (added)
 * stage:  Accepted => Ready for checkin


Comment:

 Patch works nice for me. I tested that by adding new unittest TestCase
 with assert False. Before applying the patch, the test was skipped and
 after - the test failed (as expected). That's a pity it's no good way to
 add a real test for that.

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