예제 #1
0
class TestMatchObject(unittest.TestCase):
    def setUp(self):
        self.match = Match("MatchName")
        self.participant1 = Participant("Part1")

    def testMatchInit(self):
        self.assertEqual(self.match.name, "MatchName")

    def testAddParticipant(self):
        self.match.add_participant(self.participant1)
        self.assertListEqual(self.match.participants, [self.participant1])

    def testAddingMoreThanTwoParticipants(self):
        for i in range(3):
            self.match.add_participant(self.participant1)
        self.assertEqual(len(self.match.participants), 2)
예제 #2
0
class TestMatchObject(unittest.TestCase):

    def setUp(self):
        self.match = Match("MatchName");
        self.participant1 = Participant("Part1")

    def testMatchInit(self):
       self.assertEqual(self.match.name, "MatchName")

    def testAddParticipant(self):
        self.match.add_participant(self.participant1)
        self.assertListEqual(self.match.participants, [self.participant1])

    def testAddingMoreThanTwoParticipants(self):
        for i in range(3):
            self.match.add_participant(self.participant1)
        self.assertEqual(len(self.match.participants), 2)
예제 #3
0
def UserMatchView(request):
    test_match = Match(1)
    return HttpResponse(test_match.filter())
예제 #4
0
 def match(self, response, pk):
     test_match = Match(pk)
     return HttpResponse(test_match.filter())
예제 #5
0
 def setUp(self):
     self.match = Match("MatchName");
     self.participant1 = Participant("Part1")
예제 #6
0
 def setUp(self):
     self.match = Match("MatchName")
     self.participant1 = Participant("Part1")