[Bug 27554] New: Wrong test for Koha::Patrons->update_category_to
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Bug ID: 27554 Summary: Wrong test for Koha::Patrons->update_category_to Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: fridolin.somers@biblibre.com QA Contact: testopia@bugs.koha-community.org One unit test for Koha::Patrons->update_category_to seems wrong : is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_young=>1})->update_category_to({category=>$a_categorycode}),1,'One child patron updated to adult category'); Child is updated to adult because he his too old, not too young. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chris@bigballofwax.co.nz |fridolin.somers@biblibre.co | |m Depends on| |17168 Status|NEW |ASSIGNED Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17168 [Bug 17168] Add a command line script for updating patron category based on status -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Wrong test for |Wrong test for |Koha::Patrons->update_categ |Koha::Patrons->update_categ |ory_to |ory_to child to adult -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 --- Comment #1 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 115849 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115849&action=edit Bug 27554: Add a test for Koha::Patrons->update_category_to child to adult One unit test for Koha::Patrons->update_category_to seems wrong : is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_young=>1})->update_category_to({category=>$a_categorycode}),1,'One child patron updated to adult category'); Child is updated to adult because he his too old, not too young. This patch adds a test on category of patron that should be an adult after update. Test plan : 1) Without patch, run t/db_dependent/Patrons.t 2) It does not fail 3) Apply patch, run t/db_dependent/Patrons.t 4) It fails on test 'The over age patron has been updated to adult category' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 --- Comment #2 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 115850 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115850&action=edit Bug 27554: Fix test for Koha::Patrons->update_category_to child to adult This patch fixes the test by using too_old instead of too_young Test plan : Apply patch, run t/db_dependent/Patrons.t, tests are OK -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |26307 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26307 [Bug 26307] misc/cronjobs/update_patrons_category.pl --too_old acts a year too early -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115849|0 |1 is obsolete| | --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 115860 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115860&action=edit Bug 27554: Add a test for Koha::Patrons->update_category_to child to adult One unit test for Koha::Patrons->update_category_to seems wrong : is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_young=>1})->update_category_to({category=>$a_categorycode}),1,'One child patron updated to adult category'); Child is updated to adult because he his too old, not too young. This patch adds a test on category of patron that should be an adult after update. Test plan : 1) Without patch, run t/db_dependent/Patrons.t 2) It does not fail 3) Apply patch, run t/db_dependent/Patrons.t 4) It fails on test 'The over age patron has been updated to adult category' Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115850|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 115861 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115861&action=edit Bug 27554: Fix test for Koha::Patrons->update_category_to child to adult This patch fixes the test by using too_old instead of too_young Test plan : Apply patch, run t/db_dependent/Patrons.t, tests are OK Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #5 from Nick Clemens <nick@bywatersolutions.com> --- I see what you thought here, but actually the patron was updated because they were too young child1 is 4 years old - too young for child account The script will move you to the next categry without checking the age limits for that category - i believe this is how the past script worked too. It is not a logical test, but valid child3 is 18 - you make your tests affect this patron instead - maybe we want your test in addition to the existing tests? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 --- Comment #6 from Fridolin Somers <fridolin.somers@biblibre.com> --- (In reply to Nick Clemens from comment #5)
I see what you thought here, but actually the patron was updated because they were too young
child1 is 4 years old - too young for child account
The script will move you to the next category without checking the age limits for that category - i believe this is how the past script worked too. It is not a logical test, but valid OK but I'm working on adding a check on age limits so it breaks this test.
child3 is 18 - you make your tests affect this patron instead - maybe we want your test in addition to the existing tests?
Yes, in my opinion test should verify which patron is impacted. But the test also checks that a child looses its guarantor so it must be from child to adult. Why not fix the test ? It would me more clear in case it fails. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115860|0 |1 is obsolete| | Attachment #115861|0 |1 is obsolete| | --- Comment #7 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 115933 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115933&action=edit Bug 27554: Clarify and add tests This patch adds a comment to the existing tests, clarifying what they test, and verifying the expected patron is affected. The original test should be broken by 26307 when the behvaiour is prevented I additionally add a test for 'too old' To test: 1 - Apply patch 2 - Prove tests, they should pass 3 - Verify the comments make sense -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115933|0 |1 is obsolete| | --- Comment #8 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 115934 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115934&action=edit Bug 27554: Clarify and add tests This patch adds a comment to the existing tests, clarifying what they test, and verifying the expected patron is affected. The original test should be broken by 26307 when the behvaiour is prevented I additionally add a test for 'too old' To test: 1 - Apply patch 2 - Prove tests, they should pass 3 - Verify the comments make sense Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Wrong test for |Clarify and add tests for |Koha::Patrons->update_categ |Koha::Patrons->update_categ |ory_to child to adult |ory_to child to adult -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115934|0 |1 is obsolete| | --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 116097 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116097&action=edit Bug 27554: Clarify and add tests This patch adds a comment to the existing tests, clarifying what they test, and verifying the expected patron is affected. The original test should be broken by 26307 when the behvaiour is prevented I additionally add a test for 'too old' To test: 1 - Apply patch 2 - Prove tests, they should pass 3 - Verify the comments make sense Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Nice cooperation here :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #116097|0 |1 is obsolete| | --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 116171 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116171&action=edit Bug 27554: Clarify and add tests for update_category_to This patch adds a comment to the existing tests, clarifying what they test, and verifying the expected patron is affected. The original test should be broken by 26307 when the behvaiour is prevented I additionally add a test for 'too old' To test: 1 - Apply patch 2 - Prove tests, they should pass 3 - Verify the comments make sense Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> JD amended patch: behvaiour ==> behaviour and add more info to the commit title -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |21.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 21.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.05.00 |21.05.00,20.11.03 released in| | Status|Pushed to master |Pushed to stable --- Comment #13 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com Status|Pushed to stable |Pushed to oldstable Version(s)|21.05.00,20.11.03 |21.05.00,20.11.03,20.05.09 released in| | --- Comment #14 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Pushed to 20.05.x for 20.05.09 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Version(s)|21.05.00,20.11.03,20.05.09 |21.05.00,20.11.03,20.05.09, released in| |19.11.15 Status|Pushed to oldstable |Pushed to oldoldstable --- Comment #15 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Backported: Pushed to 19.11.x branch for 19.11.15 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27554 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org