Ben test.py modülü hazırlandıNeden django testlerimı görmüyor?
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from forum.models import *
class SimpleTest(TestCase):
def setUp(self):
u = User.objects.create_user("ak", "[email protected]", "pwd")
Forum.objects.create(title="forum")
Site.objects.create(domain="test.org", name="test.org")
def content_test(self, url, values):
"""Get content of url and test that each of items in `values` list is present."""
r = self.c.get(url)
self.assertEquals(r.status_code, 200)
for v in values:
self.assertTrue(v in r.content)
def test(self):
self.c = Client()
self.c.login(username="ak", password="pwd")
self.content_test("/forum/", ['<a href="/forum/forum/1/">forum</a>'])
....
dolu ve benim uygulamayla klasöre koydum. i test veritabanı oluşturduktan sonra
python manage.py test forum
tarafından testleri çalıştırdığınızda ı bir cevap ben yanlış yapıyorum
"0.000s 0 testleri Ran" olsun?
P.S.
MyProj:
forum (it's my app):
manage.py
models.py
views.py
tests.py
...
Ben tests.py için test.py değiştirildi: İşte benim proje hiyerarşi olduğunu. Eclipse, bu modülün testlerle olduğunu, ancak cevabın hala "0,000s içinde 0 koşulu var" olduğunu belirtiyor.
'test.py' nerede yaşıyor? –