[10.0][ADD][web_chatter_paste] - #548
Conversation
|
Thanks @mreficent @lreficent can you review? It osnfor v10 |
|
Can somebody help me with the tests? I don't know how to make tests for controllers. |
|
Tested on runbot, I can attach both ways but when sending the message it is not actually sent. I don't know if this is a runbot problem though. |
|
Hi, why this doesn't work on all the browsers (or Firefox mainly)? Is this not working also on mobiles (the paste option, of course)? |
|
@lreficent This is an issue of runbot. I installed the module on a fresh environment and it worked. |
|
@pedrobaeza I made a mistake. It actually works for Firefox, but only for Gecko version 50 or higher. https://developer.mozilla.org/nl/docs/Web/API/DataTransferItem |
LoisRForgeFlow
left a comment
There was a problem hiding this comment.
Tested on local with Firefox and Chromium 👍
|
@tarteo - Regarding the controller tests, what kind of issues were you running into? Looking at this controller, it could be something simple like: |
|
@lasley I don't remember anymore... haha. Thanks though! I will make the tests asap. |
|
@lasley I don't understand why my tests are not working. It works on my development machine.
Can you help me please? |
|
Tests are working locally but not here. Is this a known problem? |
|
@tarteo - sorry I missed your last comment. Hrmmm it's working on Runbot too. I honestly have no idea, maybe try a rebase on 10.0? This totally looks like something glitchy, and not something your end - I'm not even able to load the Travis build. |
Initial commit Initial commit [ADD] Tests [FIX] Dependencies [REM] Controller tests [FIX] Removed unnecessary incompatibility warning [FIX] Hyperlink to issues [ADD] Tests [FIX] Tests [?] Testing test problem [?] Testing test problem [?] Testing test problem
…/web into 100_add_web_chatter_paste
|
@lasley I've made it work using 'MagicMock' https://docs.python.org/3/library/unittest.mock.html 😄 |
| 'c1gYQAAAAASUVORK5CYII=' | ||
|
|
||
| request = http.request | ||
| http.request = MagicMock(env=self.env) |
There was a problem hiding this comment.
This is not correctly unpatching. You should mock using with statements & patching like so:
with mock.patch.object(http, 'request') as request:
request.env = self.env
....
Not doing this will leave the request object as a mock in the http module. This will then affect subsequent tests if they require a request.
There was a problem hiding this comment.
Oh I didn't know that. Thanks I'll fix it.
|
@lasley fixed it |
| Known issues / Roadmap | ||
| ====================== | ||
|
|
||
| * Dropping files only works in Chrome. |
There was a problem hiding this comment.
Is this comment outdated now?

This module makes it easier to upload attachments while composing a message (chatter).
Paste an image (e.g. a screenshot) or drop any file into the composer and it will be automatically added as attachment.
Browser support: