Beispiel #1
0
def create_user(username, password, first_name, \
        last_name, email, organization):

    success, payload = _execute_test(
        'admin/get_access_token.json',
        None,
        None,
        None,
        None,
        {
            'username': '******',
            'password': hashlib.sha256('password').hexdigest(),
        },
        'POST',
    )
    token = payload['token']

    success, payload = _execute_test(
        'admin/create_user.json',
        token,
        None,
        None,
        None,
        {
            'user_type': 'moderator',
            'client_id': str(uuid.uuid4()),
            'username': username,
            'password': password,
            'first_name': first_name,
            'last_name': last_name,
            'email': email,
            'organization': organization,
            'fence_top_left_lat': 43.4,
            'fence_top_left_lng': -77.9,
            'fence_bottom_right_lat': 43.0,
            'fence_bottom_right_lng': -77.3,
        },
        'POST',
    )
    print 'New User ID: {0}'.format(payload['user_id'])
Beispiel #2
0
def create_user(username, password, first_name, \
        last_name, email, organization):

    success, payload = _execute_test(
        'admin/get_access_token.json',
        None,
        None,
        None,
        None,
        {
            'username': '******',
            'password': hashlib.sha256('password').hexdigest(),
        },
        'POST',
    )
    token = payload['token'] 

    success, payload = _execute_test(
        'admin/create_user.json',
        token,
        None,
        None,
        None,
        {
            'user_type': 'moderator',
            'client_id': str(uuid.uuid4()),
            'username': username,
            'password': password,
            'first_name': first_name,
            'last_name':  last_name,
            'email': email,
            'organization': organization,
            'fence_top_left_lat': 43.4,
            'fence_top_left_lng': -77.9,
            'fence_bottom_right_lat': 43.0,
            'fence_bottom_right_lng': -77.3,
        },
        'POST',
    )
    print 'New User ID: {0}'.format(payload['user_id'])
Beispiel #3
0
import uuid
import hashlib
import json

if __name__ == '__main__':

    _language_code = 'en'
    _lat = 43.2
    _lng = -77.5

    random_client_id = str(uuid.uuid4())
    success, payload = _execute_test(
        'get_assignments.json',
        random_client_id,
        _language_code,
        _lat,
        _lng,
        {},
        'GET',
    )
    assignments = payload['assignments']
    log('Assignment Count: {0}'.format(len(assignments)))
    log('----')

    success, payload = _execute_test(
        'get_stories.json',
        random_client_id,
        _language_code,
        _lat,
        _lng,
        {},
Beispiel #4
0
import uuid
import hashlib
import json

if __name__ == '__main__':

    _language_code = 'en'
    _lat = 43.2
    _lng = -77.5

    random_client_id = str(uuid.uuid4())
    success, payload = _execute_test(
        'get_assignments.json',
        random_client_id,
        _language_code,
        _lat,
        _lng,
        {},
        'GET',
    )
    assignments = payload['assignments']
    log('Assignment Count: {0}'.format(len(assignments)))
    log('----')

    success, payload = _execute_test(
        'get_stories.json',
        random_client_id,
        _language_code,
        _lat,
        _lng,
        {},