def test_authorities_post_with_data(client, authority_number, token, status):
    """
    This test relies on the configuration option ADMIN_ONLY_AUTHORITY_CREATION = True, set in conf.py
    """
    response = client.post(
        api.url_for(AuthoritiesList),
        data=json.dumps({'name': f'testauthority{authority_number}', 'owner': 'test@example.com',
                         'common_name': 'testauthority1.example.com', "serial_number": 1,
                         "validityStart": "2023-07-12T07:00:00.000Z",
                         "validityEnd": "2050-07-13T07:00:00.000Z",
                         'plugin': {'slug': 'cryptography-issuer'}}),
        headers=token
    )
    assert response.status_code == status, f"expected code {status}, but actual code was {response.status_code}; error: {response.json}"

    This test relies on the configuration option ADMIN_ONLY_AUTHORITY_CREATION = True, set in conf.py
    
lemur/tests/test_authorities.py