Fakultas Ilmu Komputer UI

Commit 9cd8e9b3 authored by Dave Nathanael's avatar Dave Nathanael
Browse files

[GREEN] Add test for AccountHistory string representation

parent 1df27b44
......@@ -6,7 +6,7 @@ from rest_framework.authtoken.models import Token
from rest_framework.test import APITestCase, APIClient
from apps.accounts.tests.factories.accounts import AccountFactory, UserFactory
from apps.accounts.models import Account
from apps.accounts.models import Account, AccountHistory
from apps.constants import (
HEADER_PREFIX,
ACTIVITY_TYPE_CREATE,
......@@ -42,6 +42,12 @@ class AccountViewTest(APITestCase):
officer_str = f"[Officer] {self.officer.user.username}"
self.assertEqual(officer_str, str(self.officer))
def test_history_string_representation(self):
history = AccountHistory.objects.all().first()
history_str = f"[History] Rev. {history.revision_id} - {history.name}"
self.assertEqual(history_str, str(history))
def test_list_all_accounts_success(self):
url = self.BASE_URL
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment