1
1
import pytest
2
2
3
- from fastapi_app .api_models import BrandFilter , ItemPublic , PriceFilter
3
+ from fastapi_app .api_models import Filter , ItemPublic
4
4
from tests .data import test_data
5
5
6
6
@@ -12,7 +12,7 @@ def test_postgres_build_filter_clause_without_filters(postgres_searcher):
12
12
def test_postgres_build_filter_clause_with_filters (postgres_searcher ):
13
13
assert postgres_searcher .build_filter_clause (
14
14
[
15
- BrandFilter ( comparison_operator = "=" , value = "AirStrider" ),
15
+ Filter ( column = "brand" , comparison_operator = "=" , value = "AirStrider" ),
16
16
]
17
17
) == (
18
18
"WHERE brand = 'AirStrider'" ,
@@ -23,11 +23,11 @@ def test_postgres_build_filter_clause_with_filters(postgres_searcher):
23
23
def test_postgres_build_filter_clause_with_filters_numeric (postgres_searcher ):
24
24
assert postgres_searcher .build_filter_clause (
25
25
[
26
- PriceFilter ( comparison_operator = "<" , value = 30 ),
26
+ Filter ( column = "price" , comparison_operator = "<" , value = 30 ),
27
27
]
28
28
) == (
29
- "WHERE price < 30.0 " ,
30
- "AND price < 30.0 " ,
29
+ "WHERE price < 30" ,
30
+ "AND price < 30" ,
31
31
)
32
32
33
33
0 commit comments