Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
amyasnikov committed Sep 23, 2024
1 parent 5f294da commit 2a866d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions validity/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,11 @@ def get_paginate_by(self, request, max_paginate_by) -> int:
return max_paginate_by // 2

def get_paginator_class(self, max_paginate_by, orphans):
def get_page_lengths(self):
return (max_paginate_by // 2, max_paginate_by)

return type(
"CustomPaginator",
(EnhancedPaginator,),
{
"get_page_lengths": get_page_lengths,
"get_page_lengths": lambda self: (max_paginate_by // 2, max_paginate_by),
"__init__": partialmethod(EnhancedPaginator.__init__, orphans=orphans),
},
)
Expand Down
3 changes: 1 addition & 2 deletions validity/tests/test_utils/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,5 @@ class A:

A2 = partialcls(A, b=10)
assert A2(5) == A(5, 10)
assert A2(1, 2) == A(1, 2)
assert A2(a=3, b=4) == A(3, 4)
assert type(A2(1, 2)) is A
assert type(A2(1)) is A

0 comments on commit 2a866d2

Please sign in to comment.