def client_login(client, url=True, callback=''):

    new_test_user()
    if url:
        url = reverse('auth_login') + '?next=' + reverse('tms_timesheets')
    if callback=='':
        url = reverse('auth_login') + '?next=' + reverse('tms_timesheets')
    else:
        url = reverse('auth_login') + '?next=' + callback
    
    response = client.post(url, {'username': TEST_USER_USERNAME, 'password': TEST_USER_PASSWORD})
    return client, response
Helper function.
dataset/ETHPy150Open adlibre/Adlibre-TMS/adlibre_tms/apps/tms/tests/helpers.py/client_login