Permalink
Browse files

zope driver attach_file method did not function properly, fixed

  • Loading branch information...
1 parent 715ecf1 commit 14eca20b7cad85b554a79d25a9f207365c6a6ef5 Frank Kwok committed Oct 5, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 splinter/driver/zopetestbrowser.py
@@ -193,9 +193,10 @@ def uncheck(self, name):
control.value = []
def attach_file(self, name, file_path):
+ filename = file_path.split('/')[-1]
control = self._browser.getControl(name=name)
content_type, _ = mimetypes.guess_type(file_path)
- control.add_file(open(file_path), content_type, None)
+ control.add_file(open(file_path), content_type, filename)
def _find_links_by_xpath(self, xpath):
html = lxml.html.fromstring(self.html)

0 comments on commit 14eca20

Please sign in to comment.