Python/Django tests running only one test at a time
Posted
by
user2876296
on Stack Overflow
See other posts from Stack Overflow
or by user2876296
Published on 2013-10-21T15:52:17Z
Indexed on
2013/10/21
15:53 UTC
Read the original article
Hit count: 135
I have a unittest for my view
class TestFromAllAdd(TestCase):
fixtures = ['staging_accounts_user.json',
'staging_main_category.json',
'staging_main_dashboard.json',
'staging_main_location.json',
'staging_main_product.json',
'staging_main_shoppinglist.json']
def setUp(self):
self.factory = RequestFactory()
self.c = Client()
self.c.login(username='admin', password='admin')
def from_all_products_html404_test(self):
request = self.factory.post('main/adding_from_all_products', {'product_id': ''})
request.user = User.objects.get(username= 'admin')
response = adding_from_all_products(request)
self.assertEqual(response.status_code, 404)
But I have a few more classes with tests and I cant run them all at the same time:
python manage.py test main
doesnt run tests, but if i run;
python manage.py test main.TestFromAllAdd.from_all_products_html404_test
, runs one test;
© Stack Overflow or respective owner