Re: [Django] #5416: Add assertNumQueries() to testing framework

2010-10-10 Thread Django
#5416: Add assertNumQueries() to testing framework
+---
  Reporter:  adrian | Owner:  Alex   
Status:  new| Milestone:  1.3
 Component:  Testing framework  |   Version:  SVN
Resolution: |  Keywords:  feature_request
 Stage:  Accepted   | Has_patch:  1  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  1  |  
+---
Changes (by Alex):

  * owner:  alexkoshelev => Alex
  * status:  assigned => new

-- 
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-upda...@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] #5416: Add assertNumQueries() to testing framework

2010-10-03 Thread Django
#5416: Add assertNumQueries() to testing framework
+---
  Reporter:  adrian | Owner:  alexkoshelev   
Status:  assigned   | Milestone:  1.3
 Component:  Testing framework  |   Version:  SVN
Resolution: |  Keywords:  feature_request
 Stage:  Accepted   | Has_patch:  1  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  1  |  
+---
Changes (by ericholscher):

  * milestone:  => 1.3

-- 
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-upda...@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] #5416: Add assertNumQueries() to testing framework

2010-09-09 Thread Django
#5416: Add assertNumQueries() to testing framework
+---
  Reporter:  adrian | Owner:  alexkoshelev   
Status:  assigned   | Milestone: 
 Component:  Testing framework  |   Version:  SVN
Resolution: |  Keywords:  feature_request
 Stage:  Accepted   | Has_patch:  1  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  1  |  
+---
Changes (by anonymous):

 * cc: kmike (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-upda...@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] #5416: Add assertNumQueries() to testing framework

2010-06-03 Thread Django
#5416: Add assertNumQueries() to testing framework
+---
  Reporter:  adrian | Owner:  alexkoshelev   
Status:  assigned   | Milestone: 
 Component:  Testing framework  |   Version:  SVN
Resolution: |  Keywords:  feature_request
 Stage:  Accepted   | Has_patch:  1  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  1  |  
+---
Changes (by adamnelson):

  * needs_better_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 post to this group, send email to django-upda...@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] #5416: Add assertNumQueries() to testing framework

2009-08-22 Thread Django
#5416: Add assertNumQueries() to testing framework
+---
  Reporter:  adrian | Owner:  alexkoshelev   
Status:  assigned   | Milestone: 
 Component:  Testing framework  |   Version:  SVN
Resolution: |  Keywords:  feature_request
 Stage:  Accepted   | Has_patch:  1  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  0  |  
+---
Changes (by alexkoshelev):

 * cc: alexkoshelev (added)
  * owner:  kkubasik => alexkoshelev
  * status:  new => assigned

-- 
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] #5416: Add assertNumQueries() to testing framework

2009-08-22 Thread Django
#5416: Add assertNumQueries() to testing framework
+---
  Reporter:  adrian | Owner:  kkubasik   
Status:  new| Milestone: 
 Component:  Testing framework  |   Version:  SVN
Resolution: |  Keywords:  feature_request
 Stage:  Accepted   | Has_patch:  1  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  0  |  
+---
Comment (by russellm):

 @Manoj - thanks for the patch, but I'm not sure this the right way to
 address the problem.

  * Your patch requires enabling settings.DEBUG - an action that can have
 unintended (and potentially query induing) consequences.
  * Your patch only works when wrapping a single callable. It's not
 something you could easily deploy in a test case, where you may want to do
 a query count check at several points in a complex test case. It also
 precludes (or makes impractical) the testing of a function that has side
 effects (so it can't be run twice) but also requires other test
 assertions.

 As noted in the ticket comments, the preferred solution is to introduce a
 signal (vis #5415) and use that signal as the basis for logging the number
 of queries. This would allow logging regardless of the value of
 settings.DEBUG. The query count could be cleared at the test setUp; the
 assertion then validates that the callback has been invoked the right
 number of times. This would allow for checking the query count without the
 need to use callable wrapping.

 There have been some recent Django-dev discussion about query logging, and
 the use of signals for this purpose was raised. It may be worth getting
 involved in this discussion if you're interested in pursuing this idea.

-- 
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] #5416: Add assertNumQueries() to testing framework

2009-08-16 Thread Django
#5416: Add assertNumQueries() to testing framework
+---
  Reporter:  adrian | Owner:  kkubasik   
Status:  new| Milestone: 
 Component:  Testing framework  |   Version:  SVN
Resolution: |  Keywords:  feature_request
 Stage:  Accepted   | Has_patch:  1  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  0  |  
+---
Comment (by Manoj Govindan ):

 I have added a custom method to `TransactionTestCase` for asserting that a
 given callable executed exactly n queries. You can use it thus:

 {{{
 class HomePageTests(django.test.TestCase):
 def test_GET_home_page_uses_exactly_five_queries(self):
 self.assertNumberofQueries(5, self.client.get, reverse('home'))

 def test_POST_home_page_uses_exactly_seven_queries(self):
 self.assertNumberofQueries(7, self.client.post, reverse('home'),
 data = {'param': 'value'})
 }}}

 Hat tip: [http://stackoverflow.com/questions/1254170/django-is-there-a
 -way-to-count-sql-queries-from-an-unit-test/1254615#1254615 Jarret
 Hardie].

-- 
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] #5416: Add assertNumQueries() to testing framework

2009-08-16 Thread Django
#5416: Add assertNumQueries() to testing framework
+---
  Reporter:  adrian | Owner:  kkubasik   
Status:  new| Milestone: 
 Component:  Testing framework  |   Version:  SVN
Resolution: |  Keywords:  feature_request
 Stage:  Accepted   | Has_patch:  1  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  0  |  
+---
Changes (by Manoj Govindan ):

  * 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 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] #5416: Add assertNumQueries() to testing framework

2009-04-20 Thread Django
#5416: Add assertNumQueries() to testing framework
+---
  Reporter:  adrian | Owner:  kkubasik   
Status:  new| Milestone: 
 Component:  Testing framework  |   Version:  SVN
Resolution: |  Keywords:  feature_request
 Stage:  Accepted   | Has_patch:  0  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  0  |  
+---
Changes (by kkubasik):

  * owner:  nobody => kkubasik

-- 
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] #5416: Add assertNumQueries() to testing framework

2009-02-28 Thread Django
#5416: Add assertNumQueries() to testing framework
+---
  Reporter:  adrian | Owner:  nobody 
Status:  new| Milestone: 
 Component:  Testing framework  |   Version:  SVN
Resolution: |  Keywords:  feature_request
 Stage:  Accepted   | Has_patch:  0  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  0  |  
+---
Comment (by mtredinnick):

 @ericholscher: it's actually something that's worth testing. If it
 increases, you need to understand why. Django shouldn't be (and doesn't)
 throw around queries just for fun; it's something that's mostly under the
 developer's control. Agree with Adrian that this is useful to have (we
 already test this kind of thing a lot now and it's slightly crufty to do
 so).

-- 
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] #5416: Add assertNumQueries() to testing framework

2009-02-25 Thread Django
#5416: Add assertNumQueries() to testing framework
+---
  Reporter:  adrian | Owner:  nobody 
Status:  new| Milestone: 
 Component:  Testing framework  |   Version:  SVN
Resolution: |  Keywords:  feature_request
 Stage:  Accepted   | Has_patch:  0  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  0  |  
+---
Comment (by ericholscher):

 This seems to be a very fragile test to provide, and changing the number
 of queries that something takes doesn't mean that it is functionally
 different. This seems a bit too specific for something to include in
 Django, especially considering that it is inherently knowing about
 internals.

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