2024-06-07 20:17:03 +03:00
|
|
|
''' Utilities for testing. '''
|
|
|
|
|
2024-07-25 19:12:31 +03:00
|
|
|
from apps.library.models import LibraryItem
|
2024-06-07 20:17:03 +03:00
|
|
|
|
|
|
|
|
|
|
|
def response_contains(response, item: LibraryItem) -> bool:
|
|
|
|
''' Check if response contains specific item. '''
|
|
|
|
return any(x for x in response.data if x['id'] == item.pk)
|