# Path: amivapi/settings.py
# DATE_FORMAT = "%Y-%m-%dT%H:%M:%SZ"


from amivapi.settings import DATE_FORMAT
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime, timedelta
from io import BytesIO
from itertools import count
from time import sleep, time
from sys import argv, stdout
import random
import requests
import statistics
import traceback
        'gender': random.choice(['male', 'female']),
        'firstname': 'Pablo%i' % next(counter),
        'lastname': 'AMIV%i' % next(counter),
        'membership': random.choice(['none', 'regular',
                                     'extraordinary', 'honorary']),
        'email': 'pablo%i@example.com' % next(counter)
    }
    return post(BASE_URL + '/users', data=data,
                auth=(ROOT_PW, '')).json()['_id']


def get_token(username, password):
    data = {
        'username': username,
        'password': password
    }
    return post(BASE_URL + '/sessions', data=data).json()['token']


def create_event():
    data = {
        'title_en': 'event%i' % next(counter),
        'description_en': 'party%i' % next(counter),
        'catchphrase_en': 'dance%i' % next(counter),
        'show_announce': random.choice([True, False]),
        'show_infoscreen': random.choice([True, False]),
        'show_website': random.choice([True, False]),
        'spots': 0,
        'time_register_start': datetime(1970, 1, 1).strftime(DATE_FORMAT),
        'time_register_end': (datetime.utcnow() +

# Path: amivapi/settings.py
# DATE_FORMAT = "%Y-%m-%dT%H:%M:%SZ"


# Path: test_performance.py
from amivapi.settings import DATE_FORMAT
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime, timedelta
from io import BytesIO
from itertools import count
from time import sleep, time
from sys import argv, stdout
import random
import requests
import statistics
import traceback

        'gender': random.choice(['male', 'female']),
        'firstname': 'Pablo%i' % next(counter),
        'lastname': 'AMIV%i' % next(counter),
        'membership': random.choice(['none', 'regular',
                                     'extraordinary', 'honorary']),
        'email': 'pablo%i@example.com' % next(counter)
    }
    return post(BASE_URL + '/users', data=data,
                auth=(ROOT_PW, '')).json()['_id']


def get_token(username, password):
    data = {
        'username': username,
        'password': password
    }
    return post(BASE_URL + '/sessions', data=data).json()['token']


def create_event():
    data = {
        'title_en': 'event%i' % next(counter),
        'description_en': 'party%i' % next(counter),
        'catchphrase_en': 'dance%i' % next(counter),
        'show_announce': random.choice([True, False]),
        'show_infoscreen': random.choice([True, False]),
        'show_website': random.choice([True, False]),
        'spots': 0,
        'time_register_start': datetime(1970, 1, 1).strftime(DATE_FORMAT),
        'time_register_end': (datetime.utcnow() +

                              timedelta(days=100)).strftime(DATE_FORMAT),