Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test misc and credit #264

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

Test misc and credit #264

wants to merge 7 commits into from

Conversation

dkaufhold
Copy link

When creating fixtures for CreditTransaction it calls self.rule.display() and fail with NotImplementedError. I'm using a rule, that has the method implemented, but still failing.
https://github.com/shoutit/shoutit-api/compare/test_misc?expand=1#diff-78647ee16003f16aa9c144f2b16f1cb2R26

Monkey patched ShoutitJSONSerializer causes RuntimeError due to max recursion depth.
https://github.com/shoutit/shoutit-api/compare/test_misc?expand=1#diff-d2e3a0c2b2bd55e14fc17b4b975f920cR53

API docs example does not work for all misc FB endpoints. Also BTW, the GET methods describe it expecting POST data and so on. So I assume docs are wrong, kind of?
https://github.com/shoutit/shoutit-api/compare/test_misc?expand=1#diff-d2e3a0c2b2bd55e14fc17b4b975f920cR75

FYI: The endpoint switches between "New York" and "Jersey City" for the coordinates in the docs even though it's clearly in Jersey. I chose "Berlin" for the tests to make sure they pass.
https://github.com/shoutit/shoutit-api/compare/test_misc?expand=1#diff-d2e3a0c2b2bd55e14fc17b4b975f920cR164

Here I tried to test for the results in the response. I've limited most of it to less than the default page size, so that even the randomisation would not take effect and drop some off the page.
Still seems as if it was failing at random places, sometimes containing the expected results and if I wait a minute or two to repeat the tests, they suddenly fail at the same point.
I experienced some issues with the cache being on while running the tests and would guess, that it might have to do with that.
Testing with an actual active cache defies the sense of testing code, because most of the time, you will not be testing the code, but only the cached response.
Do you have mechanisms in place to disable cache in tests completely? I haven't seen anything like it (i.e. in test settings or so).
https://github.com/shoutit/shoutit-api/compare/test_misc?expand=1#diff-d2e3a0c2b2bd55e14fc17b4b975f920cR282

@nourspace
Copy link
Member

When creating fixtures for CreditTransaction it calls self.rule.display() and fail with NotImplementedError. I'm using a rule, that has the method implemented, but still failing.

This is due to the initialization of subclasses not done prior to the call of display(). It is basically calling the method of the superclass.

Monkey patched ShoutitJSONSerializer causes RuntimeError due to max recursion depth.

Fixed in Dev.

API docs example does not work for all misc FB endpoints. Also BTW, the GET methods describe it expecting POST data and so on. So I assume docs are wrong, kind of?

Facebook sends regular form body not JSON

Regarding the suggestion endpoint. It is problematic by design and actually the most time consuming endpoint. It needs refactoring or complete change. I would skip it for now and only make sure it is at least not crashing. Empty arrays should be fine as long the correct keys exist.

@nourspace nourspace closed this Sep 23, 2017
@nourspace nourspace changed the base branch from dev to develop September 26, 2017 22:41
@nourspace nourspace reopened this Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants