Re: [Django] #21281: trying to override settings in test case setUpClass

2014-11-03 Thread Django
#21281: trying to override settings in test case setUpClass
--+
 Reporter:  anonymous |Owner:  nobody
 Type:  Cleanup/optimization  |   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:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by tchaumeny):

 * cc: t.chaumeny@… (added)
 * needs_docs:  1 => 0


Comment:

 We discussed it with claudep and timograham on #django-dev and came to the
 conclusion that overriding settings directly was a mistake and that we
 should not rely on `override_settings` to correct that in some cases. A
 specific warning was added to tell users not to do so
 
https://github.com/django/django/commit/3f651b3e88ac1ba8d04acd5a074362866a0a963a.

 The proposed PR moves the whole override logic at class level when the
 class is decorated. This way, settings are overriden within `setUpClass`
 and `tearDownClass` (I included bmispelon's test case above).

 A side effect of that change is that users should always call `super` when
 defining `setUpClass`/ `tearDownClass`. This side effect has been
 discussed on #20392, which this ticket is a prerequisite.

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


Re: [Django] #21281: trying to override settings in test case setUpClass

2013-10-18 Thread Django
#21281: trying to override settings in test case setUpClass
--+
 Reporter:  anonymous |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Testing framework |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  1
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by claudep):

 * version:  1.5 => master
 * type:  Uncategorized => Cleanup/optimization
 * 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/067.c5d64cf808c349af1b386cc30dd904f2%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21281: trying to override settings in test case setUpClass

2013-10-18 Thread Django
#21281: trying to override settings in test case setUpClass
---+--
 Reporter:  anonymous  |Owner:  nobody
 Type:  Uncategorized  |   Status:  new
Component:  Testing framework  |  Version:  1.5
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  1
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by claudep):

 * needs_docs:  0 => 1
 * has_patch:  0 => 1


Comment:

 The real reason why settings are not overriden in `setUpClass` is that we
 want the settings override process to happen before each test, and not
 only once for the entire class, so changed settings cannot leak between
 tests. I've attached a patch with a possible approach where we both
 override settings once in `setUpClass` and again in `_pre_setup` before
 each test. This would be a bit redundant and would require to call the
 parent `setUpClass` before settings are really overridden (would need to
 be documented).

-- 
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.91e1193f6862aba7d514d090c4b87524%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21281: trying to override settings in test case setUpClass

2013-10-18 Thread Django
#21281: trying to override settings in test case setUpClass
---+--
 Reporter:  anonymous  |Owner:  nobody
 Type:  Uncategorized  |   Status:  new
Component:  Testing framework  |  Version:  1.5
 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
---+--

Comment (by bmispelon):

 Hi,

 I can reproduce the issue described (using this testcase:
 https://gist.github.com/bmispelon/7041561).

 I don't know how fixable it is, but if anything, the limitation should at
 least be documented, so I'm accepting this ticket.

 Thanks for the report.

-- 
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.8701e0649ac233f83cbce0bbe79cecab%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21281: trying to override settings in test case setUpClass

2013-10-17 Thread Django
#21281: trying to override settings in test case setUpClass
---+--
 Reporter:  anonymous  |Owner:  nobody
 Type:  Uncategorized  |   Status:  new
Component:  Testing framework  |  Version:  1.5
 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 alasdair):

 * cc: alasdair (added)
 * needs_better_patch:   => 0
 * 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 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.a9e093808ae82d2802b308e04e847df6%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Django] #21281: trying to override settings in test case setUpClass

2013-10-16 Thread Django
#21281: trying to override settings in test case setUpClass
---+
 Reporter:  anonymous  |  Owner:  nobody
 Type:  Uncategorized  | Status:  new
Component:  Testing framework  |Version:  1.5
 Severity:  Normal |   Keywords:
 Triage Stage:  Unreviewed |  Has patch:  0
Easy pickings:  0  |  UI/UX:  0
---+
 The override_settings decorator doesn't effect the setUpClass method (I
 believe this is because class decorators don't effect classmethods) and as
 the self.settings() method requires an object instance, there is no easy
 way to change the settings for the setUpClass method.

 Is there any reason settings() requires an instance and couldn't be class
 based?

-- 
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/052.91da6932f15d445e3c038ecf519389c7%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.