Skip to content

Commit

Permalink
Fix mypy regression (typeddjango/django-stubs#1648)
Browse files Browse the repository at this point in the history
  • Loading branch information
marteinn committed Aug 15, 2023
1 parent 7ce4ea0 commit cd9cf23
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Company-Project/src/nextjs/tests/test_page_preview_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def test_missing_args_returns_400(self):
def test_preview_retrieval(self):
sub_page = HomePageFactory.create(title="Child page", parent=self.root_page)
preview = sub_page.create_page_preview()
content_type = ContentType.objects.get_for_model(sub_page.__class__)
content_type = ContentType.objects.get_for_model( # type: ignore[attr-defined]
sub_page.__class__
)

token = preview.token
content_type_str = f"{content_type.app_label}.{content_type.model}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ def handle(self, *args, **options):
password = options["password"]
email = options["email"]

User.objects.create_superuser(username=username, password=password, email=email)
User.objects.create_superuser( # type: ignore[attr-defined]
username=username,
password=password,
email=email,
)

self.stdout.write('Local user "{}" was created'.format(username))
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def test_missing_args_returns_400(self):
def test_preview_retrieval(self):
sub_page = HomePageFactory.create(title="Child page", parent=self.root_page)
preview = sub_page.create_page_preview()
content_type = ContentType.objects.get_for_model(sub_page.__class__)
content_type = ContentType.objects.get_for_model( # type: ignore[attr-defined]
sub_page.__class__
)

token = preview.token
content_type_str = f"{content_type.app_label}.{content_type.model}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ def handle(self, *args, **options):
password = options["password"]
email = options["email"]

User.objects.create_superuser(username=username, password=password, email=email)
User.objects.create_superuser( # type: ignore[attr-defined]
username=username,
password=password,
email=email,
)

self.stdout.write('Local user "{}" was created'.format(username))

0 comments on commit cd9cf23

Please sign in to comment.