[Koha-bugs] [Bug 14693] t/db_dependent/Contract.t fails do to fixed date

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Aug 21 15:43:09 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14693

Jonathan Druart <jonathan.druart at bugs.koha-community.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #41785|0                           |1
        is obsolete|                            |

--- Comment #6 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Created attachment 41786
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41786&action=edit
Bug 14693: Contract.t should generate dates based on current date

The current test for still-active contracts fails because it was written
with fixed dates, which already passed :-D

This patch calculates the current date, and uses it to generate a future
one, so the tests serve their purpose no matter what the current date is.

To test:
- Run:
  $ prove t/db_dependent/Contract.t
=> FAIL: activeonly compares contractenddate with now(), and fails
         because a fixed 2015-07-31 is writteng on the test data
- Apply the patch
- Run:
  $ prove t/db_dependent/Contract.t
=> SUCCESS: the sample data has been calculated using the current date
            and the tests pass.
- Sign off :-D

Edit: added missing use DateTime::Duration,

Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list