Last active
July 18, 2016 05:50
-
-
Save LeoHeo/849ba4edef0d726a8ce4f65c3b68d888 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_photo_job_create_should_return_201(self): | |
test_theme = 1 | |
image = settings.PROJECT_ROOT_DIR + "/dist/media/test.png" | |
test_image = SimpleUploadedFile( | |
name="test.png", | |
content=open(image, "rb").read(), | |
content_type="image/png" | |
) | |
data = { | |
"theme": test_theme, | |
"image": [ | |
test_image, | |
test_image, | |
test_image, | |
], | |
"content": [{ | |
"content_1": "1111", | |
"content_2": "2222", | |
"content_3": "3333", | |
}], | |
} | |
response = self.client.post( | |
"/api/job-history/", | |
data=data, | |
format="multipart", | |
HTTP_AUTHORIZATION="JWT {token}".format( | |
token=self.token, | |
) | |
) | |
self.assertEquals( | |
201, | |
response.status_code, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment