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