Koha-clms/t
Nick Clemens 692a5f5f29 Bug 24379: Make login_attempts not nullable
While the column defaults to 0 in Koha::Object->store we set to NULL if NULLABLE

When trying to reset a patrons password we check that the account is not administratively locked:
login_attempts != -1

This query does not return rows where login_attempts IS NULL. It will return accounts where login_attempts = 0

Let's default to 0 like we intend

To test:
1 - Create a new patron
2 - Note their login_attempts is NULL
    SELECT login_attempts FROM borrowers ORDER BY borrowernumber DESC LIMIT 1
3 - Enable  OpacResetPassword
4 - Attempt to reset password before logging in, you cannot
5 - Apply patch, updatedatabase, restart_all, update schema
6 - Create another patron
7 - Their login attempts should be 0
8 - Attempt to reset password, it works!

Bug 24379: Fix the test

First we create a patron using TestBuilder to get a hashref of valid
info. Then we delete it and create a new patron using Koha::Patron->new
Once stored, we should call discard_changes to make the calculated
values available in the currenct object.

Bug 24379: Don't drop default of 0 for login attempts

When moving the column we drop the default, this means that DBs upgraded form earlier versions
get the wrong values set

To test:
1 - Checkout 16.11.x
2 - Reset all
3 - Checkout master
4 - updatedatabase
5 - SHOW CREATE TABLE borrowers;
6 - Note the column login_attempts defaults to NULL
7 - Apply patch(es)
8 - Repeat
9 - Now it defaults ot 0 (and has NOT NULL if applied all)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7bb31cffae)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6d675b61ad)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

(cherry picked from commit f4899bafe3)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-09-19 00:42:45 +02:00
..
Acquisition
…
Biblio Bug 25709: Rename systempreference to NotesToHide 2020-09-19 00:05:47 +02:00
Budgets Bug 21817: Centralize the mock of userenv from tests 2019-01-02 20:18:29 +00:00
Circulation
…
External Bug 22010: Check preferences for ebook integration 2019-04-30 11:42:51 +00:00
Koha Bug 24191: Add to_model param to _build_order_atom and dbic_merge_sorting 2020-01-06 20:49:46 +00:00
LangInstaller/templates Bug 22007: Generated with add_missing_filters.pl 2019-01-02 20:43:53 +00:00
Members Bug 21015: Remove unecessary 'use Koha::Schema' statements in t/ 2018-11-08 02:18:48 +00:00
Number Bug 18736: (QA follow-up) Change to signed, add large int test 2019-03-21 16:29:06 +00:00
SIP
…
Search
…
Serials Bug 24903: Add tests for _handle_seqno 2020-05-13 21:44:39 +00:00
Test
…
db_dependent Bug 24379: Make login_attempts not nullable 2020-09-19 00:42:45 +02:00
edi_testfiles
…
etc
…
lib Bug 26033: Use pic.infini.fr instead of framapic 2020-09-15 03:24:05 +02:00
00-checkdatabase-version.t
…
00-deprecated.t
…
00-load.t
…
00-merge-conflict-markers.t
…
00-testcritic.t
…
00-valid-xml.t Bug 24494: Make the regex more exact 2020-03-18 21:49:07 +00:00
Auth.t Bug 22943: Remove unused line from Auth.t 2020-04-10 16:37:14 +00:00
AuthUtils.t
…
Auth_with_shibboleth.t Bug 23042: Correct shib param escaping 2019-11-22 10:35:06 +00:00
AuthoritiesMarc_MARC21.t
…
AuthoritiesMarc_UNIMARC.t
…
Barcodes_EAN13.t
…
Barcodes_annual.t
…
Barcodes_hbyymmincr.t
…
Barcodes_incremental.t
…
Biblio.t Bug 8995: (follow-up) Add tests, move open_url/coins routines to Koha namespace 2019-04-29 15:34:10 +00:00
Biblio2.t
…
Bookseller.t
…
Boolean.t
…
Budgets.t
…
Calendar.t
…
Charset.t
…
Circulation_barcodedecode.t Bug 21817: Centralize the mock of userenv from tests 2019-01-02 20:18:29 +00:00
ClassSortRoutine.t
…
ClassSortRoutine_Dewey.t
…
ClassSortRoutine_Generic.t
…
ClassSortRoutine_LCC.t
…
ClassSource.t
…
Context.t Bug 25360: Use secure flag for CGISESSID cookie when using HTTPS 2020-08-24 19:11:10 +02:00
Contract.t
…
Creators.t
…
DateUtils.t Bug 25617: (QA follow-up) Add responses to tests 2020-06-17 21:55:31 +02:00
Debug.t
…
EdiInvoice.t
…
Edifact.t
…
Ediorder.t Bug 23251: Correct formatting of IMD data ending in apostrophe 2019-08-09 14:54:12 +02:00
Ediordrsp.t
…
Form_MessagingPreferences.t
…
HtmlTags.t
…
Images.t
…
ImportBatch.t
…
Installer_PerlDependencies.t
…
Installer_PerlModules.t
…
Installer_pm.t
…
ItemCirculationAlertPreference.t
…
Koha.t Bug 23768: Adjust the test for invalid ISBN 2019-12-10 23:18:39 +00:00
Koha_Email.t
…
Koha_MetadataRecord.t
…
Koha_Template_Plugin_Cache.t
…
Koha_Template_Plugin_Koha.t
…
Koha_Util_FrameworkPlugin.t
…
Koha_Util_MARC.t
…
Labels.t Bug 15836: Add the ability to defined custom methods to split call number in labels 2018-11-13 15:18:22 +00:00
Labels_split_Regex.t Bug 15836: Add the ability to defined custom methods to split call number in labels 2018-11-13 15:18:22 +00:00
Labels_split_ccn.t Bug 15836: Fix failing tests 2018-11-13 18:53:10 +00:00
Labels_split_ddcn.t Bug 15836: Add the ability to defined custom methods to split call number in labels 2018-11-13 15:18:22 +00:00
Labels_split_lccn.t Bug 15836: Add the ability to defined custom methods to split call number in labels 2018-11-13 15:18:22 +00:00
LangInstaller.t Bug 21895: Fix translation for package install 2018-11-29 17:57:54 +00:00
Languages.t
…
Letters.t
…
Log.t Bug 20750: Add unit tests 2019-03-15 19:07:08 +00:00
Logger.t
…
Makefile.t
…
Matcher.t Bug 23324: Add an ISBN normalization routine 2019-09-05 16:55:38 +02:00
Members_AttributeTypes.t
…
Members_Attributes.t
…
Members_Messaging.t
…
OpenLibrarySearch.t
…
Output.t
…
Output_JSONStream.t
…
Patron.t
…
Patroncards.t
…
Patroncards_Batch.t
…
Patroncards_Lib.t
…
Patroncards_Patroncard.t
…
Patroncards_Profile.t
…
Patroncards_Template.t
…
Prices.t
…
Print.t
…
QueryParser.t
…
RecordProcessor.t Bug 25008: Tests for ->options 2020-05-13 22:02:55 +00:00
Ris.t
…
SMS.t
…
Scheduler.t
…
Scrubber.t
…
Search.t
…
Search_PazPar2.t
…
SimpleMARC.t Bug 22571: (follow up) fix Donald cut-&-paste error 2019-07-16 08:39:46 +02:00
SocialData.t
…
Stats.t
…
SuggestionEngine.t
…
SuggestionEngine_AuthorityFile.t
…
TmplToken.t
…
Token.t Bug 21998: Silent tests 2019-03-22 20:21:45 +00:00
XSLT.t
…
dummy.t
…
perlcriticrc
…
template_filters.t Bug 22466: Add tests 2019-03-07 18:17:32 +00:00
timezones.t
…