У меня проблема с тестом Django. Я начинаю эту команду для запуска теста:Django не работает тесты с контролем.py test
$ python manage.py test gastrobook
gastrobook мое приложение, тха COMAND будет отлично для документации Джанго, на самом деле работает, но не запускать ничего испытание, но в tests.py я написал некоторые контрольная работа! Это то, что терминал сказать:
$ python manage.py test gastrobook/
Creating test database for alias 'default'...
----------------------------------------------------------------------
Ran 0 tests in 0.000s
OK
Destroying test database for alias 'default'...
Это мой tests.py
from django.test import TestCase from gastrobook.models import * import datetime from django.utils import timezone # Create your tests here. def create_recipe(title,desc,procedimento,pub_date,hard,time,person): return Recipe.objects.create(title=title,desc=desc,procedimento=procedimento,pub_date=pub_date,hard=hard,time=time,person=person) class RecipeTest(TestCase): def setUp(self): create_recipe("cui","dcnjenj","owcjc",timezone.now(),2,"5 ore",2) def hard_no_more_than(self): recipe = Recipe.objects.all() for rec in recipe: self.assertIn(rec.hard,range(1,10))
Какая у вас версия Django? – Zulu
Можете ли вы попробовать без косой черты ('/')? Вы должны указать модуль Python (с точками ('.') в качестве разделителя), а не каталог. – Zulu