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 Jan 1, 2024
1 parent 6b5b6e4 commit 6c6c4db
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 @@ -352,3 +352,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 6c6c4db

Please sign in to comment.