Just getting started with django unit testing. I created a very simple
test, just to see how things work. Here is my test:

from django.test import TestCase

fixtures = ['auth_user', 'auth_permission', 'data_cst']

class MeasDataTest(TestCase):
    def test_MeasDate(self):
        # login
        response = self.client.post('/accounts/login//', {'username':
'admin', 'password': 'xxxxx'})
        self.assertEqual(response.status_code, 200)


I ran 'python manage.py test' and got this output:

Creating test database for alias 'default'...
....F............................................................................E.............................................................................................................................................................................................Starting
batch of 1 tasks
MockRunnerKWArgs @ 2013-07-07 18:49:43.663905
        {"value": 5}
  Completed in 0.04 seconds
  0.0421 seconds per task on average
  1 tasks succeeded (100.0% success rate)

Dispatched 1 tasks in 0.0916 seconds using 1 process.
Average time per task is 0.0916 seconds
.Starting batch of 1 tasks
MockRunnerB @ 2013-07-07 18:49:51.635251
        
  Completed in 0.03 seconds
  0.0270 seconds per task on average
  1 tasks succeeded (100.0% success rate)
  Remaining tasks: 1

Starting batch of 1 tasks
MockRunnerC @ 2013-07-07 18:49:51.655887
        
  Completed in 0.02 seconds
  0.0200 seconds per task on average
  1 tasks succeeded (100.0% success rate)

Dispatched 2 tasks in 0.0486 seconds using 1 process.
Average time per task is 0.0243 seconds
.Starting batch of 1 tasks
MockRunnerA @ 2013-07-07 18:49:59.659529
        
  Completed in 0.03 seconds
  0.0340 seconds per task on average
  1 tasks succeeded (100.0% success rate)

Dispatched 1 tasks in 0.0360 seconds using 1 process.
Average time per task is 0.0360 seconds
.Dispatched 0 tasks in 0.0017 seconds using 1 process.
....s.......................................................................
======================================================================
ERROR: test_site_profile_not_available
(django.contrib.auth.tests.models.ProfileTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/django/contrib/auth/tests/models.py",
line 29, in test_site_profile_not_available
    del settings.AUTH_PROFILE_MODULE
  File "/Library/Python/2.7/site-packages/django/utils/functional.py",
line 215, in __delattr__
    delattr(self._wrapped, name)
AttributeError: AUTH_PROFILE_MODULE

======================================================================
FAIL: test_message_attrs
(django.contrib.auth.tests.context_processors.AuthContextProcessorTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/Library/Python/2.7/site-packages/django/contrib/auth/tests/context_processors.py",
line 58, in test_message_attrs
    self.assertContains(response, "Message 1")
  File "/Library/Python/2.7/site-packages/django/test/testcases.py",
line 637, in assertContains
    msg_prefix + "Couldn't find '%s' in response" % text)
AssertionError: Couldn't find 'Message 1' in response

----------------------------------------------------------------------
Ran 350 tests in 2354.881s

FAILED (failures=1, errors=1, skipped=1)
Destroying test database for alias 'default'...

But it never ran my tests.

Questions:

-What are the lines with the dots and F, S, and s?
-What are the 350 tests it ran?
-Why didn't it run my test?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to