mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-05 02:41:14 -05:00
try fixing pagination
This commit is contained in:
@@ -14,8 +14,8 @@ from app.models import ApiKey
|
|||||||
def create_service_authorization_header(service_id, key_type=KeyType.NORMAL):
|
def create_service_authorization_header(service_id, key_type=KeyType.NORMAL):
|
||||||
client_id = str(service_id)
|
client_id = str(service_id)
|
||||||
secrets = (
|
secrets = (
|
||||||
db.session.execute(select(ApiKey))
|
db.session.execute(select(ApiKey)
|
||||||
.filter_by(service_id=service_id, key_type=key_type)
|
.filter_by(service_id=service_id, key_type=key_type))
|
||||||
.scalars()
|
.scalars()
|
||||||
.all()
|
.all()
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ def test_dao_get_paginated_inbound_sms_for_service_for_public_api_no_inbound_sms
|
|||||||
sample_service.id
|
sample_service.id
|
||||||
)
|
)
|
||||||
|
|
||||||
assert inbound_from_db == []
|
assert inbound_from_db.has_next() is False
|
||||||
|
|
||||||
|
|
||||||
def test_dao_get_paginated_inbound_sms_for_service_for_public_api_page_size_returns_correct_size(
|
def test_dao_get_paginated_inbound_sms_for_service_for_public_api_page_size_returns_correct_size(
|
||||||
@@ -299,7 +299,7 @@ def test_dao_get_paginated_inbound_sms_for_service_for_public_api_page_size_retu
|
|||||||
sample_service.id, older_than=reversed_inbound_sms[1].id, page_size=2
|
sample_service.id, older_than=reversed_inbound_sms[1].id, page_size=2
|
||||||
)
|
)
|
||||||
|
|
||||||
assert len(inbound_from_db) == 2
|
assert inbound_from_db.total == 2
|
||||||
|
|
||||||
|
|
||||||
def test_dao_get_paginated_inbound_sms_for_service_for_public_api_older_than_returns_correct_list(
|
def test_dao_get_paginated_inbound_sms_for_service_for_public_api_older_than_returns_correct_list(
|
||||||
@@ -339,7 +339,7 @@ def test_dao_get_paginated_inbound_sms_for_service_for_public_api_older_than_end
|
|||||||
sample_service.id, older_than=reversed_inbound_sms[1].id, page_size=2
|
sample_service.id, older_than=reversed_inbound_sms[1].id, page_size=2
|
||||||
)
|
)
|
||||||
|
|
||||||
assert inbound_from_db == []
|
assert inbound_from_db.has_next is False
|
||||||
|
|
||||||
|
|
||||||
def test_most_recent_inbound_sms_only_returns_most_recent_for_each_number(
|
def test_most_recent_inbound_sms_only_returns_most_recent_for_each_number(
|
||||||
|
|||||||
Reference in New Issue
Block a user