Bug 14977

Summary: Remove C4::Dates from files t/db_dependent/*.t
Product: Koha Reporter: Marc Véron <veron>
Component: Architecture, internals, and plumbingAssignee: Marc Véron <veron>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 14870    
Attachments: Bug 14977 - Remove C4::Dates from files t/db_dependent/*.t
[SIGNED-OFF] Bug 14977 - Remove C4::Dates from files t/db_dependent/*.t
Bug 14977: followup to fix NewsChanell.t
Bug 14977: followup to fix NewsChanell.t
Bug 14977 - Followup to fix issue with NewsChannels.t
Bug 14977 - Remove C4::Dates from files t/db_dependent/*.t
Bug 14977 - Followup to fix issue with NewsChannels.t

Description Marc Véron 2015-10-07 22:11:35 UTC
This patch removes C4::Dates from following files:

-  t/db_dependent/Budgets.t
-  t/db_dependent/Holds.t
-  t/db_dependent/Koha_template_plugin_KohaDates.t
-  t/db_dependent/Log.t
-  t/db_dependent/NewsChannels.t
Comment 1 Marc Véron 2015-10-07 22:17:29 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2015-10-23 09:31:38 UTC
Still applies
Comment 3 Bernardo Gonzalez Kriegel 2015-10-26 15:45:24 UTC Comment hidden (obsolete)
Comment 4 Bernardo Gonzalez Kriegel 2015-10-26 15:46:05 UTC Comment hidden (obsolete)
Comment 5 Marc Véron 2015-10-26 16:02:03 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2015-10-27 09:03:08 UTC
The NewsChannels.t test fail for me, with and without the last patch:

With:
#   Failed test 'got back expected news item via get_opac_new - ID 1'
#   at t/db_dependent/NewsChannels.t line 90.
#     Structures begin differing at:
#          $got->{expirationdate} = '12/30/2999'
#     $expected->{expirationdate} = '30/12/2999'

#   Failed test 'got back expected news item via get_opac_new - ID 2'
#   at t/db_dependent/NewsChannels.t line 112.
#     Structures begin differing at:
#          $got->{expirationdate} = '12/31/2999'
#     $expected->{expirationdate} = '31/12/2999'
# Looks like you failed 2 tests of 10.


Without:
#   Failed test 'got back expected news item via get_opac_new - ID 1'
#   at t/db_dependent/NewsChannels.t line 90.
#     Structures begin differing at:
#          $got->{expirationdate} = '30/12/2999'
#     $expected->{expirationdate} = '2999-12-30'

#   Failed test 'got back expected news item via get_opac_new - ID 2'
#   at t/db_dependent/NewsChannels.t line 112.
#     Structures begin differing at:
#          $got->{timestamp} = '01/01/2000'
#     $expected->{timestamp} = '2000-01-01'
# Looks like you failed 2 tests of 10.
Comment 7 Marc Véron 2015-10-27 19:04:58 UTC
Comment on attachment 44010 [details] [review]
Bug 14977: followup to fix NewsChanell.t

Thanks Bernardo for the trying to fix. It helped to find out what happens.
New patch follows.
Comment 8 Marc Véron 2015-10-27 19:12:18 UTC Comment hidden (obsolete)
Comment 9 Jonathan Druart 2015-10-28 11:03:42 UTC
Created attachment 44121 [details] [review]
Bug 14977 - Remove C4::Dates from files t/db_dependent/*.t

This patch removes C4::Dates from following files:

-  t/db_dependent/Budgets.t
-  t/db_dependent/Holds.t
-  t/db_dependent/Koha_template_plugin_KohaDates.t
-  t/db_dependent/Log.t
-  t/db_dependent/NewsChannels.t

To test:
- First run all tests above
- Apply patch
- Then run tests again. The results should be the same.
  (Note: I get 2 fails with NewsChannels.t, they are the same with
   and without patch).

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

NewsChanell pass for me before patch, no after.
Followup follows :)
Rest of tests pass

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Jonathan Druart 2015-10-28 11:03:45 UTC
Created attachment 44122 [details] [review]
Bug 14977 - Followup to fix issue with NewsChannels.t

The problem was that get_opac_new returns dates already syspref-formatted.

To test:
- Apply patch
- Verify that t/db_dependent/NewsChannels.t does not fail.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Tomás Cohen Arazi 2015-10-29 15:05:20 UTC
Patches pushed to master.

Thanks Marc!