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