Skip to content

Commit

Permalink
Add test for automatic UserMetadata creation
Browse files Browse the repository at this point in the history
  • Loading branch information
mvandenburgh committed Jun 7, 2022
1 parent 30ec114 commit 5a9ad75
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dandiapi/api/tests/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,3 +313,10 @@ def test_user_edu_auto_approve(user: User, api_client: APIClient, email: str, ex
assert resp.status_code == 302

assert user_metadata.status == expected_status


@pytest.mark.django_db
def test_user_auto_create_user_metadata():
"""Test that UserMetadata is automatically created for new users."""
user = User.objects.create()
assert hasattr(user, 'metadata')

0 comments on commit 5a9ad75

Please sign in to comment.