Move django TestCase classes to pytest functions
This commit is contained in:
Родитель
e54b4f371f
Коммит
756aac3506
|
@ -1,17 +0,0 @@
|
|||
from django.core.urlresolvers import reverse
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
class HomeTests(TestCase):
|
||||
|
||||
def test_page_title(self):
|
||||
response = self.client.get(reverse('home'))
|
||||
self.assertIn('<h1>Taar Api</h1>', response.content.decode('utf-8'))
|
||||
|
||||
|
||||
class TestContribute(TestCase):
|
||||
|
||||
def test_contribute_json(self):
|
||||
response = self.client.get('/contribute.json')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(response['Content-Type'], 'application/json')
|
|
@ -0,0 +1,12 @@
|
|||
from django.core.urlresolvers import reverse
|
||||
|
||||
|
||||
def test_page_title(client):
|
||||
response = client.get(reverse('home'))
|
||||
assert '<h1>Taar Api</h1>' in response.content.decode('utf-8')
|
||||
|
||||
|
||||
def test_contribute_json(client):
|
||||
response = client.get('/contribute.json')
|
||||
assert response.status_code == 200
|
||||
assert response['Content-Type'] == 'application/json'
|
Загрузка…
Ссылка в новой задаче