Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Heath committed Oct 10, 2016
1 parent 9ecb0d4 commit 3d9e658
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions onfido/live_photos.py
@@ -1,7 +1,7 @@
"""Wrapper for the live photos endpoint."""
import mimetypes

from. api_resource import ApiResource
from .api_resource import ApiResource


class LivePhotos(ApiResource):
Expand All @@ -15,6 +15,6 @@ def create(self, applicant_id, live_photo, filename):
filename: The name of the live photo file (string).
"""
content_type = mimetypes.guess_type(filename)
file = {'file': (filename, live_photo, content_type[0])}
file_data = {'file': (filename, live_photo, content_type[0])}
data = {'applicant_id': applicant_id}
return self.post('live_photos', data, file)
return self.post('live_photos', data, file_data)
7 changes: 4 additions & 3 deletions onfido/test/test_integration.py
Expand Up @@ -59,11 +59,12 @@ def test_integration_document(self):

def test_integration_live_photo(self):
api = self.create_api()
applicant = random.choice(api.Applicants.all()["applicants"])
applicant = api.Applicants.all()["applicants"][0]
live_photo = open("onfido/test/passport.png", "rb")
response = api.LivePhotos.create(applicant["id"], live_photo)
response = api.LivePhotos.create(applicant["id"], live_photo,
'passport.png')

self.assertIn("id", reponse)
self.assertIn("id", response)

def test_integration_check(self):
api = self.create_api()
Expand Down

0 comments on commit 3d9e658

Please sign in to comment.