Skip to content

Commit

Permalink
tests: fix failing tests
Browse files Browse the repository at this point in the history
* Fix redisbeat to <1.2.5
(issue liuliqiang/redisbeat#40).
* Fix patron fixtures expiration dates.
* Fix sip2 patrons expiration dates for tests.

Co-Authored-by: Pascal Repond <[email protected]>
  • Loading branch information
PascalRepond committed Oct 9, 2023
1 parent cecd63a commit 07a8796
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 36 deletions.
60 changes: 30 additions & 30 deletions data/users.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"country": "it",
"keep_history": true,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"blocked": false,
"barcode": [
"2050124311"
Expand Down Expand Up @@ -135,7 +135,7 @@
"street": "Panoramica Collinare, 47",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"2030124287"
],
Expand Down Expand Up @@ -187,7 +187,7 @@
"street": "Rue du Nord 7",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"reroils1"
],
Expand Down Expand Up @@ -215,7 +215,7 @@
"street": "520 Scott Blvd",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"2000000001"
],
Expand Down Expand Up @@ -243,7 +243,7 @@
"street": "Route du Village 6",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"10000001"
],
Expand Down Expand Up @@ -271,7 +271,7 @@
"street": "Piazza Collegiata 12",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"2050124312"
],
Expand Down Expand Up @@ -299,7 +299,7 @@
"street": "Gare 45",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"kad001"
],
Expand Down Expand Up @@ -327,7 +327,7 @@
"street": "Vignettes 25",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"kad002"
],
Expand Down Expand Up @@ -375,7 +375,7 @@
"street": "Magic Street 3",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"3050124311"
],
Expand All @@ -402,7 +402,7 @@
"street": "Diagon Alley 72",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"3050124312"
],
Expand Down Expand Up @@ -836,7 +836,7 @@
"street": "Faubourg du Lac 6",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"920001"
],
Expand Down Expand Up @@ -864,7 +864,7 @@
"street": "Rue du Tr\u00e9sor 9",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"920002"
],
Expand Down Expand Up @@ -892,7 +892,7 @@
"street": "Rue de l'Industrie 46",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"920003"
],
Expand Down Expand Up @@ -920,7 +920,7 @@
"street": "Avenue Max-Huber 2",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"920004"
],
Expand Down Expand Up @@ -948,7 +948,7 @@
"street": "Rue de Montsalvens 3",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"920005"
],
Expand Down Expand Up @@ -976,7 +976,7 @@
"street": "Rue du Vieux-Pont 3",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"920006"
],
Expand Down Expand Up @@ -1004,7 +1004,7 @@
"street": "Seefeldstrasse 37",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"920007"
],
Expand Down Expand Up @@ -1032,7 +1032,7 @@
"street": "In Stierwisen 98",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"920008"
],
Expand Down Expand Up @@ -1060,7 +1060,7 @@
"street": "Im Wingert 117",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"920009"
],
Expand Down Expand Up @@ -1088,7 +1088,7 @@
"street": "Werkstrasse 136",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"920010"
],
Expand Down Expand Up @@ -1116,7 +1116,7 @@
"street": "L\u00fctzelfl\u00fchstrasse 120",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"920011"
],
Expand Down Expand Up @@ -1144,7 +1144,7 @@
"street": "\u00dcerklisweg 55",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"920012"
],
Expand Down Expand Up @@ -1172,7 +1172,7 @@
"street": "Via Verbano 109",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"920013"
],
Expand All @@ -1199,7 +1199,7 @@
"street": "Quadra 93",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"920014"
],
Expand Down Expand Up @@ -1227,7 +1227,7 @@
"street": "Via Camischolas sura 63",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"920015"
],
Expand Down Expand Up @@ -1255,7 +1255,7 @@
"street": "Lungolago 118",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"920016"
],
Expand Down Expand Up @@ -1283,7 +1283,7 @@
"street": "Ranftweg 1",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"999999"
],
Expand Down Expand Up @@ -1356,7 +1356,7 @@
"street": "Galaxy street",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"cypress-1"
],
Expand Down Expand Up @@ -1384,7 +1384,7 @@
"street": "Milky Way street",
"keep_history": false,
"patron": {
"expiration_date": "2023-10-07",
"expiration_date": "2100-10-07",
"barcode": [
"cypress-2"
],
Expand Down Expand Up @@ -1412,7 +1412,7 @@
"street": "Via Croix Noire 3",
"keep_history": true,
"patron": {
"expiration_date": "2024-10-07",
"expiration_date": "2100-10-07",
"blocked": false,
"barcode": [
"2100154311"
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ isbnlib = ">=3.9.1"
requests = ">=2.20.0"
polib = "*"
xmltodict = "*"
redisbeat = "*"
redisbeat = "<1.2.5"
jsonpickle = ">=1.4.1"
ciso8601 = "*"
# TODO: to be removed when the thumbnail will be refactored
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/circulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def patron_martigny(
@pytest.fixture(scope="module")
def librarian_patron_martigny_data(data):
"""Load Martigny librarian patron data."""
return deepcopy(data.get('ptrn14'))
return deepcopy(patch_expiration_date(data.get('ptrn14')))


@pytest.fixture(scope="module")
Expand Down
7 changes: 4 additions & 3 deletions tests/fixtures/sip2.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
from copy import deepcopy

import pytest
from utils import create_patron, create_selfcheck_terminal, create_user_token
from utils import create_patron, create_selfcheck_terminal, \
create_user_token, patch_expiration_date


@pytest.fixture(scope="module")
def selfcheck_librarian_martigny_data(data):
"""Load Martigny librarian data."""
return deepcopy(data.get('ptrn2'))
return deepcopy(patch_expiration_date(data.get('ptrn2')))


@pytest.fixture(scope="module")
Expand Down Expand Up @@ -62,7 +63,7 @@ def selfcheck_termial_martigny_data(data):
@pytest.fixture(scope="module")
def selfcheck_patron_martigny_data(data):
"""Load Martigny librarian data."""
return deepcopy(data.get('ptrn6'))
return deepcopy(patch_expiration_date(data.get('ptrn6')))


@pytest.fixture(scope="module")
Expand Down

0 comments on commit 07a8796

Please sign in to comment.