Re: [Django] #20456: Easier unit testing for class-based views

2019-12-04 Thread Django
#20456: Easier unit testing for class-based views
-+-
 Reporter:  Benoît Bryon |Owner:  Felipe
 |  Lee
 Type:  New feature  |   Status:  closed
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  cbv test | 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 Carlton Gibson ):

 In [changeset:"87483757c80e76ea85586f2cb81bdfa1976d10e2" 87483757]:
 {{{
 #!CommitTicketReference repository=""
 revision="87483757c80e76ea85586f2cb81bdfa1976d10e2"
 [3.0.x] Fixed #20456 -- Added example of directly testing CBVs in topics
 docs.

 Backport of a2e96f7969059fb4e621a1cd591fbdd0d4deae2e 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.e0bfc5e4baa5698eddf4a482cdb3c2ac%40djangoproject.com.


Re: [Django] #20456: Easier unit testing for class-based views

2019-12-04 Thread Django
#20456: Easier unit testing for class-based views
-+-
 Reporter:  Benoît Bryon |Owner:  Felipe
 |  Lee
 Type:  New feature  |   Status:  closed
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  cbv test | 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 Carlton Gibson ):

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


Comment:

 In [changeset:"a2e96f7969059fb4e621a1cd591fbdd0d4deae2e" a2e96f79]:
 {{{
 #!CommitTicketReference repository=""
 revision="a2e96f7969059fb4e621a1cd591fbdd0d4deae2e"
 Fixed #20456 -- Added example of directly testing CBVs in topics docs.
 }}}

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.c80ef9de6c6374e0861a4973dbfddc3c%40djangoproject.com.


Re: [Django] #20456: Easier unit testing for class-based views

2019-12-04 Thread Django
#20456: Easier unit testing for class-based views
-+-
 Reporter:  Benoît Bryon |Owner:  Felipe
 |  Lee
 Type:  New feature  |   Status:  assigned
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  cbv test | 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 Carlton Gibson):

 * 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.b2b74f1d9766b6ae8006c6de89ec4a5f%40djangoproject.com.


Re: [Django] #20456: Easier unit testing for class-based views

2019-11-24 Thread Django
#20456: Easier unit testing for class-based views
---+--
 Reporter:  Benoît Bryon   |Owner:  Felipe Lee
 Type:  New feature|   Status:  assigned
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords:  cbv test   | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Felipe Lee):

 * needs_better_patch:  1 => 0


Comment:

 Made the change a bit ago but I forgot I needed to come in here to remove
 the "Patch needs improvement" flag. Sorry about 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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.5679765ac6a8d221ce33f5100059f1b2%40djangoproject.com.


Re: [Django] #20456: Easier unit testing for class-based views

2019-10-30 Thread Django
#20456: Easier unit testing for class-based views
---+--
 Reporter:  Benoît Bryon   |Owner:  Felipe Lee
 Type:  New feature|   Status:  assigned
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords:  cbv test   | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Carlton Gibson):

 * needs_better_patch:  0 => 1


Comment:

 A few adjustments to [https://github.com/django/django/pull/11942 the docs
 PR] suggested but looking good.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.50f28e9187260e6bf05bc4a3bfe31a2f%40djangoproject.com.


Re: [Django] #20456: Easier unit testing for class-based views

2019-10-30 Thread Django
#20456: Easier unit testing for class-based views
---+--
 Reporter:  Benoît Bryon   |Owner:  Felipe Lee
 Type:  New feature|   Status:  assigned
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords:  cbv test   | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Mariusz Felisiak ):

 In [changeset:"c2c27867ef1d4ad32369f8cda42a6d72b262cae5" c2c27867]:
 {{{
 #!CommitTicketReference repository=""
 revision="c2c27867ef1d4ad32369f8cda42a6d72b262cae5"
 Refs #20456 -- Moved initialization of HEAD method based on GET to the
 View.setup() for generic views.

 This will ease unit testing of views since setup will essentially do
 everything needed to set the view instance up (other than instantiating
 it). Credit for idea goes to Vincent Prouillet.
 }}}

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.43b1356f6cdf25534a93eaad28df2a97%40djangoproject.com.


Re: [Django] #20456: Easier unit testing for class-based views

2019-10-30 Thread Django
#20456: Easier unit testing for class-based views
---+--
 Reporter:  Benoît Bryon   |Owner:  Felipe Lee
 Type:  New feature|   Status:  assigned
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords:  cbv test   | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Mariusz Felisiak ):

 In [changeset:"31d1822532d716d5b2f1422372d07dd05067bfc6" 31d18225]:
 {{{
 #!CommitTicketReference repository=""
 revision="31d1822532d716d5b2f1422372d07dd05067bfc6"
 Refs #20456 -- Added test for initialization of request/args/kwargs
 attributes in View.Setup().
 }}}

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.cb9bb038703ce7aea906249890ef09f0%40djangoproject.com.


Re: [Django] #20456: Easier unit testing for class-based views

2019-10-12 Thread Django
#20456: Easier unit testing for class-based views
---+--
 Reporter:  Benoît Bryon   |Owner:  Felipe Lee
 Type:  New feature|   Status:  assigned
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords:  cbv test   | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Felipe Lee):

 * needs_better_patch:  1 => 0


Comment:

 Brought this ticket up on django developers forum to determine path
 forward: https://groups.google.com/forum/#!topic/django-
 developers/IxesUYH5b6A
 Based on feedback, implemented changes based on the pr that had been
 proposed a few comments ago (years ago). New pull request:
 https://github.com/django/django/pull/11908

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.c2c40b2f1643c259e1a5c346d36b0fe1%40djangoproject.com.


Re: [Django] #20456: Easier unit testing for class-based views

2019-09-26 Thread Django
#20456: Easier unit testing for class-based views
---+--
 Reporter:  Benoît Bryon   |Owner:  Felipe Lee
 Type:  New feature|   Status:  assigned
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords:  cbv test   | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Felipe Lee):

 * owner:  (none) => Felipe Lee
 * status:  new => assigned


Comment:

 Looks like there's a repo out there that has a TestCase set up to make
 testing CBVs easier: https://github.com/revsys/django-test-
 plus/blob/master/test_plus/test.py#L386

 Seems like a good starting point. There's some things about that
 implementation that I'll probably change a bit. I'll also remove some
 methods that are very specific to that repo's testing classes.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.ba2ff50a2957c04ecb99259bcd7e29bf%40djangoproject.com.


Re: [Django] #20456: Easier unit testing for class-based views

2018-10-02 Thread Django
#20456: Easier unit testing for class-based views
---+
 Reporter:  Benoît Bryon   |Owner:  (none)
 Type:  New feature|   Status:  new
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords:  cbv test   | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Sergey Fedoseev):

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


Re: [Django] #20456: Easier unit testing for class-based views

2016-12-11 Thread Django
#20456: Easier unit testing for class-based views
---+
 Reporter:  Benoît Bryon   |Owner:  (none)
 Type:  New feature|   Status:  new
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords:  cbv test   | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Tim Graham):

 * status:  assigned => new
 * owner:  Marc Tamlyn => (none)


Comment:

 I don't see anyone actively working on it. Feel free to work on it if you
 like.

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


Re: [Django] #20456: Easier unit testing for class-based views

2016-12-10 Thread Django
#20456: Easier unit testing for class-based views
-+-
 Reporter:  Benoît Bryon |Owner:  Asif
 |  Saifuddin Auvi
 Type:  New feature  |   Status:  assigned
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  cbv test | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Eron Lloyd):

 Any update on this? I'm planning on moving to CBVs but this is concerning
 for my testing needs.

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


Re: [Django] #20456: Easier unit testing for class-based views

2015-03-22 Thread Django
#20456: Easier unit testing for class-based views
---+
 Reporter:  benoitbryon|Owner:  auvipy
 Type:  New feature|   Status:  assigned
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords:  cbv test   | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+
Changes (by auvipy):

 * owner:  mjtamlyn => auvipy


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


Re: [Django] #20456: Easier unit testing for class-based views

2015-03-05 Thread Django
#20456: Easier unit testing for class-based views
---+
 Reporter:  benoitbryon|Owner:  mjtamlyn
 Type:  New feature|   Status:  assigned
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords:  cbv test   | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+

Comment (by auvipy):

 Hi Marc what are the tasks remaining to get this ticket merged? If you
 don't have time let me do the rest on behalf of you

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


Re: [Django] #20456: Easier unit testing for class-based views

2014-07-08 Thread Django
#20456: Easier unit testing for class-based views
---+
 Reporter:  benoitbryon|Owner:  mjtamlyn
 Type:  New feature|   Status:  assigned
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords:  cbv test   | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+
Changes (by timo):

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


Re: [Django] #20456: Easier unit testing for class-based views

2014-03-03 Thread Django
#20456: Easier unit testing for class-based views
---+
 Reporter:  benoitbryon|Owner:  mjtamlyn
 Type:  New feature|   Status:  assigned
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords:  cbv test   | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by bmispelon):

 * has_patch:  0 => 1


Comment:

 Someone made a proposal here: https://github.com/django/django/pull/2368/

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


Re: [Django] #20456: Easier unit testing for class-based views

2013-12-31 Thread Django
#20456: Easier unit testing for class-based views
---+
 Reporter:  benoitbryon|Owner:  mjtamlyn
 Type:  New feature|   Status:  assigned
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords:  cbv test   | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by anonymous):

 How about something like MyCBView.as_object(request, *args, !**kwargs)
 instead of the setup_view approach?

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


Re: [Django] #20456: Easier unit testing for class-based views

2013-12-25 Thread Django
#20456: Easier unit testing for class-based views
---+
 Reporter:  benoitbryon|Owner:  mjtamlyn
 Type:  New feature|   Status:  assigned
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords:  cbv test   | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by unaizalakain):

 * cc: unai@… (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/069.d9252eabefab0ddf79f0217004272cd9%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #20456: Easier unit testing for class-based views

2013-12-12 Thread Django
#20456: Easier unit testing for class-based views
---+
 Reporter:  benoitbryon|Owner:  mjtamlyn
 Type:  New feature|   Status:  assigned
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords:  cbv test   | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by benoitbryon):

 Perhaps this feature would make it possible to simplify tests around
 Django's generic views:

 * perhaps tests such as
 
https://github.com/django/django/blob/a71ff762356a46f37d189f503f0ec2aaaca6ad0e/tests/generic_views/test_base.py#L231
 could be simplified
 * perhaps
 
https://github.com/django/django/blob/a71ff762356a46f37d189f503f0ec2aaaca6ad0e/tests/generic_views/urls.py
 could be removed

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


Re: [Django] #20456: Easier unit testing for class-based views

2013-12-12 Thread Django
#20456: Easier unit testing for class-based views
---+
 Reporter:  benoitbryon|Owner:  mjtamlyn
 Type:  New feature|   Status:  assigned
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords:  cbv test   | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by benoitbryon):

 I have 2 use cases for this feature:

 * As a library developer, I want to test generic class-based views without
 having to register them in URLconf.
 * As a project developer, given I override some generic class-based view
 in order to customize something (such as "get_template_names" or
 "get_context_data" methods), I want to test only the methods I overrid (I
 suppose other methods are covered elsewhere).

 Here is an example TestCase in django-downloadview:
 https://github.com/benoitbryon/django-
 
downloadview/blob/6dd090757a8aaad72f9195d22c7933ae97f02a7d/django_downloadview/tests/views.py#L208
 The idea is that PathDownloadView customizes get_file() method, so, I want
 to test that. Notice that django-downloadview is a library that does not
 provide URLconf, so I appreciate to test views without having to setup
 some fake URLconf.

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


Re: [Django] #20456: Easier unit testing for class-based views

2013-06-05 Thread Django
#20456: Easier unit testing for class-based views
---+
 Reporter:  benoitbryon|Owner:  mjtamlyn
 Type:  New feature|   Status:  assigned
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords:  cbv test   | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Natim):

 * cc: Natim (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/069.a7739ef09aae6f8ac82c322a0e026b01%40djangoproject.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #20456: Easier unit testing for class-based views

2013-05-19 Thread Django
#20456: Easier unit testing for class-based views
---+
 Reporter:  benoitbryon|Owner:  mjtamlyn
 Type:  New feature|   Status:  assigned
Component:  Testing framework  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords:  cbv test   | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by mjtamlyn):

 * owner:  nobody => mjtamlyn
 * keywords:   => cbv test
 * status:  new => assigned
 * cc: marc.tamlyn@… (added)
 * stage:  Unreviewed => Accepted


Comment:

 Accepted in principle, not necessarily the design.

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




Re: [Django] #20456: Easier unit testing for class-based views

2013-05-19 Thread Django
#20456: Easier unit testing for class-based views
---+--
 Reporter:  benoitbryon|Owner:  nobody
 Type:  New feature|   Status:  new
Component:  Testing framework  |  Version:  master
 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 bmispelon):

 * cc: bmispelon@… (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.
For more options, visit https://groups.google.com/groups/opt_out.




[Django] #20456: Easier unit testing for class-based views

2013-05-19 Thread Django
#20456: Easier unit testing for class-based views
---+
 Reporter:  benoitbryon|  Owner:  nobody
 Type:  New feature| Status:  new
Component:  Testing framework  |Version:  master
 Severity:  Normal |   Keywords:
 Triage Stage:  Unreviewed |  Has patch:  0
Easy pickings:  0  |  UI/UX:  0
---+
 When django users create class-based views, they create custom code.
 Testing this code matters. Writing unit tests for the custom code (and
 only for the custom code) is important.

 As of Django 1.5, the easiest way to test class-based views is using the
 builtin test client. But it performs integration tests, i.e. involves
 middlewares, URL resolvers, decorators...
 It is also quite easy to use django.test.RequestFactory and as_view()
 classmethod. But, since as_view() returns a function, the tests can only
 check the response. It means the class-based views are tested as a system.

 It seems that writing unit tests is possible, i.e. we can write unit tests
 for class-based views methods.
 There is at least one technique which was presented at DjangoCon Europe
 2013 Warsaw:

 * http://tech.novapost.fr/static/images/slides/djangocon-europe-2013-unit-
 test-class-based-views.html
 * http://tech.novapost.fr/django-unit-test-your-views-en.html

 The recipe mentioned above seems to work (to be confirmed). But wouldn't
 be better if the recipe was documented in Django's documentation
 (https://docs.djangoproject.com/en/1.5/topics/testing/advanced/ I guess)
 and tools (setup_view) were builtin Django?

 Note: perhaps, it would be even better if setup_view() is not a standalone
 function but is a method of View class. Something like as_view(), but
 which returns an instance.

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