test models, urls, views - 100%
This commit is contained in:
20
tests/unit/profiles/test_urls.py
Normal file
20
tests/unit/profiles/test_urls.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import pytest
|
||||
from django.urls import reverse
|
||||
from django.test import Client
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_should_get_200_on_profile_index():
|
||||
""" test the server's response """
|
||||
c = Client()
|
||||
url = reverse('profiles_index')
|
||||
response = c.get(url)
|
||||
assert response.status_code == 200
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_should_get_200_on_profile_detail(sample_profile):
|
||||
c = Client()
|
||||
url = reverse('profile', kwargs={'username': "TestUser"})
|
||||
response = c.get(url)
|
||||
assert response.status_code == 200
|
||||
|
||||
Reference in New Issue
Block a user