Skip to content

Commit

Permalink
DBにレコードが追加されていないことを確認と提案事項実装
Browse files Browse the repository at this point in the history
  • Loading branch information
Kotaro0722 committed Nov 12, 2024
1 parent 342acda commit 4e13596
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions accounts/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def test_failure_post_with_empty_password(self):
self.assertEqual(response.status_code, 200)
self.assertFalse(User.objects.filter(username=invalid_data["username"]).exists())
self.assertFalse(form.is_valid())
self.assertIn("このフィールドは必須です。", form.errors["password1"])
self.assertIn("このフィールドは必須です。", form.errors["password2"])

def test_failure_post_with_duplicated_user(self):
Expand All @@ -94,6 +95,7 @@ def test_failure_post_with_duplicated_user(self):

self.assertEqual(response.status_code, 200)
self.assertFalse(form.is_valid())
self.assertEqual(User.objects.filter(username=duplicated_data["username"]).count(), 1)
self.assertIn("同じユーザー名が既に登録済みです。", form.errors["username"])

def test_failure_post_with_invalid_email(self):
Expand Down

0 comments on commit 4e13596

Please sign in to comment.