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

Add test scripts for current API calls for Up app #2205

Closed
1 task done
stellanl opened this issue May 24, 2016 · 2 comments
Closed
1 task done

Add test scripts for current API calls for Up app #2205

stellanl opened this issue May 24, 2016 · 2 comments

Comments

@stellanl
Copy link
Contributor

stellanl commented May 24, 2016

These should test the basic functionality of the API endpoints that Up uses.

Requirements:

  • A test user account in RSR so we can obtain an API key and access non-public functions. It must be connected to an organisation with at least one project for which at least one update is posted. Both project and update should have photos.
@stellanl
Copy link
Contributor Author

stellanl commented May 24, 2016

Minimal read-only session URL usage:
Success is if all calls return 2nn codes.

  1. Get an API key; "Logging in"

POST /auth/token
with a body of
username={testuser}
password={pwd}
and returns a body like this
{
"username": "teststellan",
"user_id": 1465,
"organisations": [411, 411, 361],
"allow_edit_projects": [4412, 4241, 467, 293],
"api_key": "fe30377723549e09e0707b4d3518fcb5977f7e09",
"published_projects": [4412, 4241, 2036, 2035, 2034, 2033, 2031, 2029, 2024, 2022, 2021, 1336, 1117, 1114, 852, 677, 659, 467, 293, 284, 275, 138, 54]
}

  1. Fetching project data
    nnn is one of the published projects ids returned in (1)
    The API key must be supplied in an Authorization: header as "Token " + api_key

GET /rest/v1/project_up/nnn/?format=xml&image_thumb_name=up&image_thumb_up_width=100
GET /rest/v1/country/?format=json&limit=50
GET /rest/v1/project_update/?format=xml&project=nnn&last_modified_at__gt=1970-01-01T00:00:00
Up then fetches data for all users referenced by the updates:
GET /rest/v1/user/uuu/?format=json&depth=1
and all the organisations the users are employed by
GET /rest/v1/organisation/ooo/?format=json
and finally the images for projects and updates
GET /db/project/2/update/5298/ProjectUpdate_5298_photo_2014-07-24_13.35.05.jpg

@KasperBrandt
Copy link
Contributor

Test plan

Wait for the tests to run and successfully complete.

damienallen added a commit that referenced this issue Jun 24, 2016
@MichaelAkvo MichaelAkvo moved this to Done in RSR Dec 8, 2022
@MichaelAkvo MichaelAkvo added this to RSR Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

5 participants