Skip to content

Commit

Permalink
feat: Updated src/accounts/tests.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] authored Oct 23, 2023
1 parent 8b3dcf5 commit dce7142
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions src/accounts/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def test_post(self):

class UpdateAccountViewTest(TestCase):
def setUp(self):
self.user = User.objects.create_user(username='test', password='test')
self.user = User.objects.create_user(username='test', password=faker.password())

def test_post(self):
self.client.login(username='test', password='test')
Expand All @@ -199,7 +199,7 @@ def test_post(self):

class UpdateCharactersViewTest(TestCase):
def setUp(self):
self.user = User.objects.create_user(username='test', password='test')
self.user = User.objects.create_user(username='test', password=faker.password())

def test_post(self):
self.client.login(username='test', password='test')
Expand All @@ -209,7 +209,7 @@ def test_post(self):

class RequestVerificationTokenViewTest(TestCase):
def setUp(self):
self.user = User.objects.create_user(username='test', password='test')
self.user = User.objects.create_user(username='test', password=faker.password())

def test_get(self):
self.client.login(username='test', password='test')
Expand All @@ -220,26 +220,9 @@ def test_get(self):
class VerifyAccountViewTest(TestCase):
def setUp(self):
self.user = User.objects.create_user(username='test', password=faker.password())

def test_post(self):
self.client.login(username='test', password=faker.password())
response = self.client.post(reverse('update_account'), {'username': 'new_test'})
self.assertEqual(response.status_code, 200)
self.assertEqual(response.data['username'], 'new_test')

def test_post(self):
self.client.login(username='test', password=faker.password())
response = self.client.post(reverse('update_characters'), {'characters_data': {'character1': 'data1'}})
self.assertEqual(response.status_code, 200)
self.assertEqual(response.data['characters_data'], {'character1': 'data1'})

def test_get(self):
self.client.login(username='test', password=faker.password())
response = self.client.get(reverse('request_verification_token'))
self.assertEqual(response.status_code, 200)
self.assertEqual(response.data['account_identifier'], self.user.account_identifier)

def test_post(self):
response = self.client.post(reverse('verify_account'), {'account_identifier': self.user.account_identifier})
self.assertEqual(response.status_code, 200)
self.assertEqual(response.data, PublicAccountDataSerializer(self.user).data)

0 comments on commit dce7142

Please sign in to comment.