contest type 的表示类型修改为常量

0 即为是小组赛(GROUP_CONTEST),1 即为是无密码的公开赛(PUBLIC_CONTEST),2 即为是有密码的公开赛(PASSWORD_PUBLIC_CONTEST)
This commit is contained in:
hohoTT
2015-09-09 19:39:42 +08:00
parent fddd1d866e
commit 24758a3589
5 changed files with 69 additions and 45 deletions

View File

@@ -5,6 +5,7 @@ from django.core.urlresolvers import reverse
from account.models import User, REGULAR_USER, ADMIN, SUPER_ADMIN
from problem.models import Problem
from contest.models import Contest
from contest.models import GROUP_CONTEST, PUBLIC_CONTEST, PASSWORD_PUBLIC_CONTEST
from submission.models import Submission
from rest_framework.test import APITestCase, APIClient
@@ -82,7 +83,8 @@ class SubmissionAPITest(APITestCase):
hint="hint1",
created_by=User.objects.get(username="test2"))
self.global_contest = Contest.objects.create(title="titlex", description="descriptionx", mode=1,
contest_type=2, show_rank=True, show_user_submission=True,
contest_type=PASSWORD_PUBLIC_CONTEST, show_rank=True,
show_user_submission=True,
start_time="2015-08-15T10:00:00.000Z",
end_time="2015-08-15T12:00:00.000Z",
password="aacc", created_by=User.objects.get(username="test2"))
@@ -151,7 +153,8 @@ class SubmissionAdminAPITest(APITestCase):
hint="hint1",
created_by=self.user)
self.global_contest = Contest.objects.create(title="titlex", description="descriptionx", mode=1,
contest_type=2, show_rank=True, show_user_submission=True,
contest_type=PASSWORD_PUBLIC_CONTEST, show_rank=True,
show_user_submission=True,
start_time="2015-08-15T10:00:00.000Z",
end_time="2015-08-15T12:00:00.000Z",
password="aacc", created_by=self.user)
@@ -190,7 +193,8 @@ class SubmissionPageTest(TestCase):
hint="hint1",
created_by=User.objects.get(username="test1"))
self.global_contest = Contest.objects.create(title="titlex", description="descriptionx", mode=1,
contest_type=2, show_rank=True, show_user_submission=True,
contest_type=PASSWORD_PUBLIC_CONTEST, show_rank=True,
show_user_submission=True,
start_time="2015-08-15T10:00:00.000Z",
end_time="2015-08-15T12:00:00.000Z",
password="aacc", created_by=User.objects.get(username="test1"))