コード例 #1
0
 def test_get_competitors_with_admission_company(self):
     mommy.make(
         "dpnk.Company",
         name="Foo company",
     )
     competition = mommy.make(
         "dpnk.Competition",
         competitor_type="company",
         campaign=self.campaign,
     )
     query = results.get_competitors(competition)
     self.assertQuerysetEqual(query.all(), ['<Company: Foo company>'])
コード例 #2
0
 def test_get_competitors_with_admission_single(self):
     mommy.make(
         "dpnk.UserAttendance",
         userprofile__nickname="Foo user",
         campaign=self.campaign,
         transactions=[mommy.make('Payment', status=99)],
         approved_for_team='approved',
     )
     competition = mommy.make(
         "dpnk.Competition",
         competitor_type="single_user",
         campaign=self.campaign,
     )
     query = results.get_competitors(competition)
     self.assertQuerysetEqual(query.all(), ['<UserAttendance: Foo user>'])
コード例 #3
0
 def test_get_competitors_liberos(self):
     team = mommy.make(
         "dpnk.Team",
         name="Foo team",
         campaign=self.campaign,
     )
     mommy.make(
         "dpnk.UserAttendance",
         userprofile__nickname="Foo user",
         team=team,
         campaign=self.campaign,
         approved_for_team='approved',
     )
     team.save()
     competition = mommy.make(
         "dpnk.Competition",
         competitor_type="liberos",
         campaign=self.campaign,
     )
     query = results.get_competitors(competition)
     self.assertQuerysetEqual(query.all(), ['<UserAttendance: Foo user>'])
コード例 #4
0
 def test_get_competitors_with_admission_team(self):
     team = mommy.make(
         "dpnk.Team",
         name="Foo team",
         campaign=self.campaign,
     )
     for name in ["Foo user", "Bar user"]:
         mommy.make(
             "dpnk.UserAttendance",
             userprofile__nickname=name,
             team=team,
             campaign=self.campaign,
             approved_for_team='approved',
         )
     team.save()
     competition = mommy.make(
         "dpnk.Competition",
         competitor_type="team",
         campaign=self.campaign,
     )
     query = results.get_competitors(competition)
     self.assertQuerysetEqual(query.all(),
                              ['<Team: Foo team (Foo user, Bar user)>'])
コード例 #5
0
def test_get_competitors_liberos(liberos_competition, team, ua1):
    query = results.get_competitors(liberos_competition)
    assert str(query.all()) == "<QuerySet [<UserAttendance: Foo user>]>"
コード例 #6
0
def test_get_competitors_with_admission_company(company, company_competition):
    competition = company_competition
    query = results.get_competitors(competition)
    assert str(query.all()) == "<QuerySet [<Company: Foo company>]>"
コード例 #7
0
def test_get_competitors_with_admission_team(ua1, ua2, team, team_competition):
    competition = team_competition
    query = results.get_competitors(competition)
    assert str(
        query.all()) == "<QuerySet [<Team: Foo team (Bar user, Foo user)>]>"
コード例 #8
0
def test_get_competitors_with_admission_single(ua1, single_user_competition):
    competition = single_user_competition
    query = results.get_competitors(competition)
    assert str(query.all()) == "<QuerySet [<UserAttendance: Foo user>]>"