Merge pull request #3055 from Andrew-Chen-Wang/patch-6

This commit is contained in:
Bruno Alla 2021-02-22 20:18:54 +00:00 committed by GitHub
commit d4bc89bcbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View File

@ -7,7 +7,7 @@ User = get_user_model()
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ["username", "email", "name", "url"]
fields = ["username", "name", "url"]
extra_kwargs = {
"url": {"view_name": "api:user-detail", "lookup_field": "username"}

View File

@ -28,7 +28,6 @@ class TestUserViewSet:
assert response.data == {
"username": user.username,
"email": user.email,
"name": user.name,
"url": f"http://testserver/api/users/{user.username}/",
}