def get(self, request, *args, **kwargs): client_instance = client_check(request.user) response = {'client_img': load_client_img(client_instance), 'data': cv_page_get(client_instance), } # сюда влетел словарь который сформировался в pages_get return render(request, self.template_name, response) # а здесь он залетел в соответствующий
def get(self, request, *args, **kwargs): client_instance = client_check(request.user) response = { 'client_img': load_client_img(client_instance), 'data': cv_page_get(client_instance), } return render(request, self.template_name, response)
def test_POST_user_3(self): """ request.POST with LoggedIn User and TEST_DATA_3. """ self.client.login(username=self.TEST_USER_USERNAME, password=self.TEST_USER_PASSWORD) response = self.client.post(path=self.url, data=self.TEST_DATA_3) # saves to DB ???? user_cvs = CV.objects.filter(client_cv=self.client_inst) print("t3_val: %s" % user_cvs.values()) for cv, count in zip(user_cvs, range(1, len(user_cvs) + 1)): self.assertEqual(cv.position, None) self.assertEqual(cv.direction, None) self.assertEqual(cv.employment, None) self.assertEqual( cv.time_job, TimeJob.objects.get(id=self.TEST_DATA_3['time_job%s' % count])) self.assertEqual(cv.salary, None) self.assertEqual(cv.type_salary, None) self.assertEquals(response.status_code, 302) # redirect cv_arr = cv_page_get(self.client_inst)['cl_cvs'] # print(cv_arr) response = self.client.get(self.url) # print(response.context['data']['cl_cvs']) self.assertEqual(response.context['data']['cl_cvs'], cv_arr) self.assertEqual(response.status_code, 200)