Skip to content

Commit

Permalink
Add test for #117
Browse files Browse the repository at this point in the history
  • Loading branch information
atodorov committed Mar 23, 2018
1 parent 65ceb3a commit 23394dc
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Check that when overriding the 'objects' attribite of a model class
# with a manager from the django-model-utils package pylint-django
# does not report not-an-iterator error
# pylint: disable=missing-docstring

from model_utils.managers import InheritanceManager

from django.db import models


class BaseModel(models.Model):
name = models.CharField()


class BuggyModel(models.Model):
objects = InheritanceManager()

name = models.CharField()


def function():
for record in BaseModel.objects.all():
print(record.name)

for record in BuggyModel.objects.all():
print(record.name)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[testoptions]
requires = django-model-utils
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ deps =
django20: Django>=2.0,<2.1
py{27,34,35,36}: coverage
py{27,34,35,36}: djangorestframework
py{27,34,35,36}: psycopg2
py{27,34,35,36}: django-model-utils
py{27,34,35,36}: django-tables2
py{27,34,35,36}: psycopg2
py{27,34,35,36}: pylint-plugin-utils
py{27,34,35,36}: pytest
setenv =
Expand Down

0 comments on commit 23394dc

Please sign in to comment.