Exemple #1
0
 def test_mission_location_has_missions(self):
     """Locations should have a reference back to related missions."""
     location = Location(name='Smallville')
     location.save()
     mission = Mission(location=location)
     mission.save()
     expected_missions = [mission]
     actual_missions = list(location.missions.all())
     self.assertEqual(expected_missions, actual_missions)
Exemple #2
0
 def test_mission_has_lfg_requests(self):
     """A Mission should be associated with its LFGRequests."""
     player = make_player()
     toon = Character(
         name='Scarlet Letter', server=0, role=0, powerset=0, player=player)
     toon.save()
     location = Location(name='Someplace')
     location.save()
     mission = Mission(name='FooMissionBar', location=location)
     mission.save()
     lfg = LFGRequest(character=toon, mission=mission)
     lfg.save()
     expected_requests = [lfg]
     actual_requests = list(mission.requests.all())
     self.assertEqual(expected_requests, actual_requests)
Exemple #3
0
 def test_character_has_lfg_requests(self):
     """A Character should be associated with his/her LFGRequests."""
     player = make_player()
     toon = Character(
         name='Duskstrike', server=0, role=0, powerset=0, player=player)
     toon.save()
     location = Location(name='Somewhere')
     location.save()
     mission = Mission(name='FooMission', location=location)
     mission.save()
     lfg = LFGRequest(character=toon, mission=mission)
     lfg.save()
     expected_requests = [lfg]
     actual_requests = list(toon.requests.all())
     self.assertEqual(expected_requests, actual_requests)