Esempio n. 1
0
    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)
Esempio n. 2
0
    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
                                              )
Esempio n. 3
0
 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="******"))
Esempio n. 4
0
 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)
Esempio n. 5
0
 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")