Skip to content

Commit

Permalink
Disable no-member in test file
Browse files Browse the repository at this point in the history
b/c this test file is only to validate we don't get the traceback
seen in #232
  • Loading branch information
atodorov committed Jul 7, 2019
1 parent e1a5aa9 commit 17c8b6d
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
"""
Checks that Pylint does not complain about ForeignKey pointing to model
in module of models package
Checks that Pylint does not crash with ForeignKey string reference pointing to model
in module of models package. See
https://github.com/PyCQA/pylint-django/issues/232
Note: the no-member disable is here b/c pylint-django doesn't know how to
load models.author.Author. When pylint-django tries to load models referenced
by a single string it assumes they are found in the same module it is inspecting.
Hence it can't find the Author class here so it tells us it doesn't have an
'id' attribute. Also see:
https://github.com/PyCQA/pylint-django/issues/232#issuecomment-495242695
"""
# pylint: disable=missing-docstring
# pylint: disable=missing-docstring, no-member
from django.db import models


Expand All @@ -12,4 +20,4 @@ class FairyTail(models.Model):
author = models.ForeignKey(to='Author', null=True, on_delete=models.CASCADE)

def get_author_name(self):
return self.author.id
return self.author.id # disable via no-member

0 comments on commit 17c8b6d

Please sign in to comment.