Skip to content

Commit

Permalink
updates CustomHistoricalAttrsTest test to use TestCase setUp
Browse files Browse the repository at this point in the history
  • Loading branch information
NoelJames committed Sep 25, 2023
1 parent b26f5ce commit eed2f52
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions simple_history/tests/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,13 +514,16 @@ def test_bulk_update_history_wrong_manager(self):

class CustomHistoricalAttrsTest(TestCase):

def test_bulk_create_history_with_custom_model_attributes(self):
data = [
def setUp(self):
self.data = [
PollWithHistoricalSessionAttr(id=x, question='Question ' + str(x))
for x in range(5)
]

def test_bulk_create_history_with_custom_model_attributes(self):

bulk_create_with_history(
data, PollWithHistoricalSessionAttr,
self.data, PollWithHistoricalSessionAttr,
custom_historical_attrs={'session': 'jam'}
)

Expand All @@ -531,13 +534,6 @@ def test_bulk_create_history_with_custom_model_attributes(self):
)

def test_bulk_update_history_with_custom_model_attributes(self):
create_data = [
PollWithHistoricalSessionAttr(id=x, question='Question ' + str(x))
for x in range(5)
]

bulk_create_with_history(create_data, PollWithHistoricalSessionAttr)

update_data = [
PollWithHistoricalSessionAttr(id=x, question='Q' + str(x))
for x in range(5)
Expand Down

0 comments on commit eed2f52

Please sign in to comment.