Merge pull request #2874 from pydanny/mypy-django-stubs

Update mypy and django-stubs
This commit is contained in:
Bruno Alla 2020-10-04 12:13:57 +01:00 committed by GitHub
commit a5ab4ae1cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -13,8 +13,8 @@ watchgod==0.6 # https://github.com/samuelcolvin/watchgod
# Testing
# ------------------------------------------------------------------------------
mypy==0.770 # https://github.com/python/mypy
django-stubs==1.5.0 # https://github.com/typeddjango/django-stubs
mypy==0.782 # https://github.com/python/mypy
django-stubs==1.6.0 # https://github.com/typeddjango/django-stubs
pytest==6.1.0 # https://github.com/pytest-dev/pytest
pytest-sugar==0.9.4 # https://github.com/Frozenball/pytest-sugar

View File

@ -12,6 +12,8 @@ class UserAdmin(auth_admin.UserAdmin):
form = UserChangeForm
add_form = UserCreationForm
fieldsets = (("User", {"fields": ("name",)}),) + auth_admin.UserAdmin.fieldsets
fieldsets = (("User", {"fields": ("name",)}),) + tuple(
auth_admin.UserAdmin.fieldsets
)
list_display = ["username", "name", "is_superuser"]
search_fields = ["name"]

View File

@ -64,7 +64,7 @@ class TestUserDetailView:
def test_not_authenticated(self, user: User, rf: RequestFactory):
request = rf.get("/fake-url/")
request.user = AnonymousUser() # type: ignore
request.user = AnonymousUser()
response = user_detail_view(request, username=user.username)