Skip to content

Commit

Permalink
fixup! Use setUpTestData() to speed up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dato committed Dec 5, 2023
1 parent aecdf59 commit 54f763e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bookwyrm/tests/models/test_status_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ def setUpTestData(self):
)
self.book = models.Edition.objects.create(title="Test Edition")

def setUp(self):
"""individual test setup"""
self.anonymous_user = AnonymousUser
self.anonymous_user.is_authenticated = False
image_file = pathlib.Path(__file__).parent.joinpath(
"../../static/images/default_avi.jpg"
)
Expand All @@ -54,9 +58,6 @@ def setUpTestData(self):
image.save(output, format=image.format)
self.book.cover.save("test.jpg", ContentFile(output.getvalue()))

self.anonymous_user = AnonymousUser
self.anonymous_user.is_authenticated = False

def test_status_generated_fields(self, *_):
"""setting remote id"""
status = models.Status.objects.create(content="bleh", user=self.local_user)
Expand Down

0 comments on commit 54f763e

Please sign in to comment.