Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 3
0
def UserMatchView(request):
    test_match = Match(1)
    return HttpResponse(test_match.filter())
Ejemplo n.º 4
0
 def match(self, response, pk):
     test_match = Match(pk)
     return HttpResponse(test_match.filter())
Ejemplo n.º 5
0
 def setUp(self):
     self.match = Match("MatchName");
     self.participant1 = Participant("Part1")
Ejemplo n.º 6
0
 def setUp(self):
     self.match = Match("MatchName")
     self.participant1 = Participant("Part1")