Skip to content
Snippets Groups Projects
Commit 4b6e5c0a authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Update cnames test

cnames entered in CSEntry are just names not FQDN
See d1f500238c5798259f536bb80fa93aba2d493b97
parent 915ead71
No related branches found
No related tags found
No related merge requests found
......@@ -182,6 +182,6 @@ class CnameFactory(factory.alchemy.SQLAlchemyModelFactory):
sqlalchemy_session = common.Session
sqlalchemy_session_persistence = 'commit'
name = factory.Sequence(lambda n: f'host{n}.example.org')
name = factory.Sequence(lambda n: f'host{n}')
interface = factory.SubFactory(InterfaceFactory)
user = factory.SubFactory(UserFactory)
......@@ -871,7 +871,7 @@ def test_create_cname(client, interface, admin_token):
# check that name and interface_id are mandatory
response = post(client, f'{API_URL}/network/cnames', data={}, token=admin_token)
check_response_message(response, "Missing mandatory field 'name'", 422)
response = post(client, f'{API_URL}/network/cnames', data={'name': 'myhost.example.org'}, token=admin_token)
response = post(client, f'{API_URL}/network/cnames', data={'name': 'myhost'}, token=admin_token)
check_response_message(response, "Missing mandatory field 'interface_id'", 422)
response = post(client, f'{API_URL}/network/cnames', data={'interface_id': interface.id}, token=admin_token)
check_response_message(response, "Missing mandatory field 'name'", 422)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment