|
|
|
@ -48,7 +48,7 @@ class TestModelFunctions(TestCase):
|
|
|
|
|
user=user,
|
|
|
|
|
previous_part=previous_part,
|
|
|
|
|
part_of=story,
|
|
|
|
|
round_number=i
|
|
|
|
|
turn_number=i
|
|
|
|
|
)
|
|
|
|
|
parts.append(new_part)
|
|
|
|
|
previous_part = new_part
|
|
|
|
@ -87,3 +87,33 @@ class TestModelFunctions(TestCase):
|
|
|
|
|
result = self.story1.get_first_unfinished_part()
|
|
|
|
|
|
|
|
|
|
self.assertEqual(result, None)
|
|
|
|
|
|
|
|
|
|
def test_next_round_ready__game_start(self):
|
|
|
|
|
self.create_users_and_story_round_with_stories_and_parts()
|
|
|
|
|
self.assertFalse(self.story_round.next_round_ready())
|
|
|
|
|
|
|
|
|
|
def test_next_round_ready__half_done(self):
|
|
|
|
|
self.create_users_and_story_round_with_stories_and_parts()
|
|
|
|
|
self.parts1[0].text = 'some text'
|
|
|
|
|
self.parts1[0].save()
|
|
|
|
|
self.assertFalse(self.story_round.next_round_ready())
|
|
|
|
|
|
|
|
|
|
def test_next_round_ready__first_round_done(self):
|
|
|
|
|
self.create_users_and_story_round_with_stories_and_parts()
|
|
|
|
|
|
|
|
|
|
self.parts1[0].text = 'some text'
|
|
|
|
|
self.parts1[0].save()
|
|
|
|
|
self.parts2[0].text = 'some text'
|
|
|
|
|
self.parts2[0].save()
|
|
|
|
|
self.assertTrue(self.story_round.next_round_ready())
|
|
|
|
|
|
|
|
|
|
def test_next_round_ready__second_round_done(self):
|
|
|
|
|
self.create_users_and_story_round_with_stories_and_parts()
|
|
|
|
|
self.story_round.current_turn = 1
|
|
|
|
|
self.story_round.save()
|
|
|
|
|
|
|
|
|
|
self.parts1[1].text = 'some text'
|
|
|
|
|
self.parts1[1].save()
|
|
|
|
|
self.parts2[1].text = 'some text'
|
|
|
|
|
self.parts2[1].save()
|
|
|
|
|
self.assertTrue(self.story_round.next_round_ready())
|
|
|
|
|