コード例 #1
0
ファイル: missions.py プロジェクト: dcuolfg/dcuolfg
 def test_mission_num_players_possible(self):
     """You should not be able to specify arbitrary num_players."""
     mission = Mission()
     mission.num_players = 33
     with self.assertRaises(ValidationError) as err:
         mission.full_clean()
     expected_message = 'Value 33 is not a valid choice.'
     message_list = err.exception.message_dict.get('num_players')
     self.assertEqual(expected_message, message_list[0])
コード例 #2
0
ファイル: missions.py プロジェクト: dcuolfg/dcuolfg
 def test_mission_update_num_players(self):
     """You should be able to update num_players for a Mission."""
     mission = Mission()
     mission.num_players = 8
     self.assertEqual(8, mission.num_players)