def setUp(self): self.client = APIClient() self.url = reverse("announcement_admin_api") self.user1 = create_user(admin_type=SUPER_ADMIN) self.user2 = create_user(username="******", email="*****@*****.**", admin_type=SUPER_ADMIN) self.announcement = Announcement.objects.create(title="bb", content="BB", created_by=self.user1)
def setUp(self): self.client = Client() user = create_user() self.a1 = Announcement.objects.create(title="aa", content="AA", created_by=user, visible=True, ) self.a2 = Announcement.objects.create(title="bb", content="BB", created_by=User.objects.get(username="******"), visible=False )
def setUp(self): self.client = APIClient() self.user = create_user() self.client.login(username="******", password="******") self.problem = Problem.objects.create(title="title1", description="description1", input_description="input1_description", output_description="output1_description", test_case_id="1", source="source1", samples=json.dumps([{"input": "1 1", "output": "2"}]), time_limit=100, memory_limit=1000, difficulty=1, hint="hint1", created_by=User.objects.get(username="******"))
def setUp(self): self.client = APIClient() self.url = reverse("problem_admin_api") self.user = create_user(admin_type=SUPER_ADMIN) self.client.login(username="******", password="******") ProblemTag.objects.create(name="tag1") ProblemTag.objects.create(name="tag2") self.problem = Problem.objects.create(title="title1", description="description1", input_description="input1_description", output_description="output1_description", test_case_id="1", source="source1", samples=json.dumps([{"input": "1 1", "output": "2"}]), time_limit=100, memory_limit=1000, difficulty=1, hint="hint1", created_by=self.user)
def setUp(self): self.client = APIClient() self.url = reverse('problem_tag_admin_api') self.user = create_user(admin_type=SUPER_ADMIN) self.client.login(username="******", password="******") ProblemTag.objects.create(name="tag1")