Skip to content

Commit

Permalink
Clean up tests a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Suor committed Oct 9, 2024
1 parent 9069063 commit 1817784
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/test_low_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def base(db):
case.tearDown()


def test_ttl(base, django_assert_num_queries):
def test_ttl(base):
user = User.objects.create(username='Suor')
qs = User.objects.cache(timeout=100).filter(pk=user.pk)
list(qs)
Expand Down
9 changes: 3 additions & 6 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,11 +648,8 @@ def test_365(self):
def test_385(self):
Client.objects.create(name='Client Name')

with self.assertRaises(AttributeError) as e:
with self.assertRaisesRegex(AttributeError, "local object"):
Client.objects.filter(name='Client Name').cache().first()
self.assertEqual(
str(e.exception),
"Can't pickle local object 'Client.__init__.<locals>.curry.<locals>._curried'")

invalidate_model(Client)

Expand Down Expand Up @@ -721,8 +718,8 @@ def test_430_no_error_raises(self):
media_type.delete()

def test_480(self):
orm_lookups = ['title__icontains', 'category__title__icontains', ]
search_terms = ['1', "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13"]
orm_lookups = ['title__icontains', 'category__title__icontains']
search_terms = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13']
queryset = Post.objects.filter(visible=True)
conditions = []
for search_term in search_terms:
Expand Down

0 comments on commit 1817784

Please sign in to comment.