network_inventory/computers/tests/test_computer_form_views.py

17 lines
488 B
Python
Raw Normal View History

2020-05-26 22:37:18 +02:00
from django.test import Client
import pytest
pytestmark = pytest.mark.django_db
def test_computer_create_view(create_admin_user):
fixture = create_admin_user()
client = Client()
client.login(username="pharma-admin", password="password")
data = {'name': 'Test Computer',
'customer': fixture['customer'].id}
url = '/customer/{}/create/computer/'.format(fixture['customer'].id)
response = client.post(url, data)
assert response.status_code == 302