Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example Django test code references missing member #989

Open
jeffwidman opened this issue Oct 27, 2022 · 0 comments
Open

Example Django test code references missing member #989

jeffwidman opened this issue Oct 27, 2022 · 0 comments

Comments

@jeffwidman
Copy link
Member

jeffwidman commented Oct 27, 2022

model = TaggedUserFactory(tag='user')

results in Pylance complaining:

Cannot access member "tag" for type "TaggedUserFactory"
  Member "tag" is unknown

Similarly:

self.assertEqual(model.content_type, ContentType.objects.get_for_model(model.content_object))

results in Pylance complaining:

Argument of type "SubFactory" cannot be assigned to parameter "model" of type "Type[Model] | Model" in function "get_for_model"
  Type "SubFactory" cannot be assigned to type "Type[Model] | Model"
    Type "SubFactory" cannot be assigned to type "Type[Model]"
    "SubFactory" is incompatible with "Model"

I poked at a bit, resulting in #988, but I don't use Django much, so still wasn't quite sure what needed to happen to fix these.

@jeffwidman jeffwidman changed the title Django test example references missing member Example Django test code references missing member Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant