dcramer/mock-django

doctests in mock_django/models.py fails

calvinchengx opened this issue · 2 comments

calvin$ ./manage.py test mock_django
Creating test database for alias 'default'...
F
======================================================================
FAIL: ModelMock (mock_django.models)
Doctest: mock_django.models.ModelMock
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./../django-trunk/django/test/_doctest.py", line 2136, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for mock_django.models.ModelMock
  File "./_thirdparty/mock-django/mock_django/models.py", line 23, in ModelMock

----------------------------------------------------------------------
File "./_thirdparty/mock-django/mock_django/models.py", line 25, in mock_django.models.ModelMock
Failed example:
    Post = ModelMock(Post)
Exception raised:
    Traceback (most recent call last):
      File "./../django-trunk/django/test/_doctest.py", line 1235, in __run
        compileflags, 1) in test.globs
      File "<doctest mock_django.models.ModelMock[0]>", line 1, in <module>
        Post = ModelMock(Post)
    NameError: name 'Post' is not defined
----------------------------------------------------------------------
File "./_thirdparty/mock-django/mock_django/models.py", line 26, in mock_django.models.ModelMock
Failed example:
    assert post.pk == post.id
Exception raised:
    Traceback (most recent call last):
      File "./../django-trunk/django/test/_doctest.py", line 1235, in __run
        compileflags, 1) in test.globs
      File "<doctest mock_django.models.ModelMock[1]>", line 1, in <module>
        assert post.pk == post.id
    NameError: name 'post' is not defined


----------------------------------------------------------------------
Ran 1 test in 0.008s

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

Seems like the doctest is giving some trouble?

Did you put mock_django in your installed apps? If so just remove it from there.

They aren't actually doctests :)

David Cramer

twitter.com/zeeg
disqus.com/zeeg

On Sunday, February 19, 2012 at 11:37 PM, Calvin Cheng wrote:

calvin$ ./manage.py test mock_django
Creating test database for alias 'default'...
F
======================================================================
FAIL: ModelMock (mock_django.models)
Doctest: mock_django.models.ModelMock
----------------------------------------------------------------------
Traceback (most recent call last):
File "./../django-trunk/django/test/_doctest.py", line 2136, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for mock_django.models.ModelMock
File "./_thirdparty/mock-django/mock_django/models.py", line 23, in ModelMock

----------------------------------------------------------------------
File "./_thirdparty/mock-django/mock_django/models.py", line 25, in mock_django.models.ModelMock
Failed example:
Post = ModelMock(Post)
Exception raised:
Traceback (most recent call last):
File "./../django-trunk/django/test/_doctest.py", line 1235, in __run
compileflags, 1) in test.globs
File "<doctest mock_django.models.ModelMock[0]>", line 1, in <module>
Post = ModelMock(Post)
NameError: name 'Post' is not defined
----------------------------------------------------------------------
File "./_thirdparty/mock-django/mock_django/models.py", line 26, in mock_django.models.ModelMock
Failed example:
assert post.pk (http://post.pk) == post.id
Exception raised:
Traceback (most recent call last):
File "./../django-trunk/django/test/_doctest.py", line 1235, in __run
compileflags, 1) in test.globs
File "<doctest mock_django.models.ModelMock[1]>", line 1, in <module>
assert post.pk (http://post.pk) == post.id
NameError: name 'post' is not defined


----------------------------------------------------------------------
Ran 1 test in 0.008s

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

Seems like the doctest is giving some trouble?


Reply to this email directly or view it on GitHub:
#1

O! Thanks for clarifying!

Sent from my iPhone

On 20 Feb, 2012, at 16:44, David Cramerreply@reply.github.com wrote:

Did you put mock_django in your installed apps? If so just remove it from there.

They aren't actually doctests :)

David Cramer

twitter.com/zeeg
disqus.com/zeeg

On Sunday, February 19, 2012 at 11:37 PM, Calvin Cheng wrote:

calvin$ ./manage.py test mock_django
Creating test database for alias 'default'...
F
======================================================================
FAIL: ModelMock (mock_django.models)
Doctest: mock_django.models.ModelMock
----------------------------------------------------------------------
Traceback (most recent call last):
File "./../django-trunk/django/test/_doctest.py", line 2136, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for mock_django.models.ModelMock
File "./_thirdparty/mock-django/mock_django/models.py", line 23, in ModelMock

----------------------------------------------------------------------
File "./_thirdparty/mock-django/mock_django/models.py", line 25, in mock_django.models.ModelMock
Failed example:
Post = ModelMock(Post)
Exception raised:
Traceback (most recent call last):
File "./../django-trunk/django/test/_doctest.py", line 1235, in __run
compileflags, 1) in test.globs
File "<doctest mock_django.models.ModelMock[0]>", line 1, in <module>
Post = ModelMock(Post)
NameError: name 'Post' is not defined
----------------------------------------------------------------------
File "./_thirdparty/mock-django/mock_django/models.py", line 26, in mock_django.models.ModelMock
Failed example:
assert post.pk (http://post.pk) == post.id
Exception raised:
Traceback (most recent call last):
File "./../django-trunk/django/test/_doctest.py", line 1235, in __run
compileflags, 1) in test.globs
File "<doctest mock_django.models.ModelMock[1]>", line 1, in <module>
assert post.pk (http://post.pk) == post.id
NameError: name 'post' is not defined


----------------------------------------------------------------------
Ran 1 test in 0.008s

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

Seems like the doctest is giving some trouble?


Reply to this email directly or view it on GitHub:
#1


Reply to this email directly or view it on GitHub:
#1 (comment)