def test_report_create(self): print("test_report_create") response = self.client.post(self.url, data={'title': 'hi', 'content': 'hello'}, **{'HTTP_AUTHORIZATION': self.access_token_1}) self.assertEqual(response.status_code, 200) 위와 같이 **을 붙여서 표현 하는데 이 때 'HTTP_'을 붙여서 표현하는 것이 중요하다. 참고글: https://ssamko.tistory.com/53 [Django] Test 코드 작성시 header 추가하기 Django를 API서버로만 이용할 때, 외부 사용자들에게 header를 통해 인증정보를..
: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease' doesn't support architecture 'i386' sudo apt-get update 할 때 위와 같은 에러가 난다면 sudo -H gedit /etc/apt/sources.list.d/pgdg.list http://apt.postgresql... 이러한 글이 나올텐데 deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main 이렇게 바꿔주자 sudo apt-get ..
def test_report_create(self): print("test_report_create") access_token = self.common_report_create({"email": "12@kakao.com", "password": "django_kakao_test"}) response = RequestsClient().post('http://127.0.0.1:8000/api/report', data={'title': 'hi', 'content': 'hello'}, headers={'Authorization': access_token}) self.assertEqual(response.status_code, 200) response = self.client.post(url, data={'con..
import selenium from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By import os, json ## 이메일 비밀번호 가져오는 코드 secret_file = os.path.join('./secrets.json') with open(secret_file) as f: secrets = json.loads(f.read()) def get_secret(keyword, secrets=secrets): try: return secrets[keyword] except: error_msg = "Set the {0} environment va..
- Total
- Today
- Yesterday
- 2021 KAKAO BLIND RECRUITMENT
- Collections
- postgres
- Command Line
- 면접
- Celery
- 카카오
- BFS
- Java
- 자바
- PostgreSQL
- ubuntu
- setattr
- docker
- 알고리즘
- headers
- 백준
- Python
- Spring
- docker-compose
- DRF
- django
- 파이썬
- thread
- Linux
- dockerignore
- env
- Pattern
- 프로그래머스
- 그래프
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |