Fakultas Ilmu Komputer UI

Commit cdd9652f authored by Rayza Arasj Mahardhika's avatar Rayza Arasj Mahardhika
Browse files

refactor test to use constants

parent bf459994
......@@ -2,7 +2,8 @@ from django.urls import resolve, reverse
from django.test import TestCase
from django.http import HttpRequest
from lists.views import home_page, about_page
from lists.views import home_page, about_page, \
COMMENTARY_ZERO, COMMENTARY_LESS_THAN_FIVE, COMMENTARY_MORE_THAN_EQUAL_FIVE
from lists.models import Item
class HomePageTest(TestCase):
......@@ -43,9 +44,9 @@ class HomePageTest(TestCase):
def test_display_correct_personal_commentary(self):
cases = [
(0, 'yey, waktunya berlibur'),
(4, 'sibuk tapi santai'),
(5, 'oh tidak')
(0, COMMENTARY_ZERO),
(4, COMMENTARY_LESS_THAN_FIVE),
(5, COMMENTARY_MORE_THAN_EQUAL_FIVE)
]
for item_count, commentary in cases:
......
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