|
|
|
@ -117,3 +117,29 @@ class TestModelFunctions(TestCase):
|
|
|
|
|
self.parts2[1].text = 'some text'
|
|
|
|
|
self.parts2[1].save()
|
|
|
|
|
self.assertTrue(self.story_round.next_round_ready())
|
|
|
|
|
|
|
|
|
|
def test_get_next_story_part__each_user_starts_with_own_story(self):
|
|
|
|
|
self.create_users_and_story_round_with_stories_and_parts()
|
|
|
|
|
|
|
|
|
|
result = self.story_round.get_next_story_part(self.user1)
|
|
|
|
|
self.assertEqual(result, self.parts1[0])
|
|
|
|
|
|
|
|
|
|
result = self.story_round.get_next_story_part(self.user2)
|
|
|
|
|
self.assertEqual(result, self.parts2[0])
|
|
|
|
|
|
|
|
|
|
def test_get_next_story_part__second_round_story_switched(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.story_round.current_turn = 1
|
|
|
|
|
self.story_round.save()
|
|
|
|
|
|
|
|
|
|
result = self.story_round.get_next_story_part(self.user1)
|
|
|
|
|
self.assertEqual(result, self.parts2[1])
|
|
|
|
|
|
|
|
|
|
result = self.story_round.get_next_story_part(self.user2)
|
|
|
|
|
self.assertEqual(result, self.parts1[1])
|