Coverage for apis_core/utils/test_helpers.py: 100%
7 statements
« prev ^ index » next coverage.py v7.6.8, created at 2024-12-20 09:24 +0000
« prev ^ index » next coverage.py v7.6.8, created at 2024-12-20 09:24 +0000
1# SPDX-FileCopyrightText: 2023 Birger Schacht
2# SPDX-License-Identifier: MIT
4from django.test import TestCase
6from .helpers import construct_lookup
8lookups = {
9 "*foo*": ("__icontains", "foo"),
10 "foo": ("__icontains", "foo"),
11 "*foo": ("__iendswith", "foo"),
12 "foo*": ("__istartswith", "foo"),
13 '"foo"': ("__iexact", "foo"),
14}
17class FilterMethodstest(TestCase):
18 def test_lookup(self):
19 for lookup in lookups:
20 self.assertEqual(construct_lookup(lookup), lookups[lookup])