from jingrow.model.pagestatus import PageStatus
from jingrow.tests.utils import JingrowTestCase


class TestPageStatus(JingrowTestCase):
	def test_draft(self):
		self.assertEqual(PageStatus(0), PageStatus.DRAFT)

		self.assertTrue(PageStatus.DRAFT.is_draft())
		self.assertFalse(PageStatus.DRAFT.is_submitted())
		self.assertFalse(PageStatus.DRAFT.is_cancelled())

	def test_submitted(self):
		self.assertEqual(PageStatus(1), PageStatus.SUBMITTED)

		self.assertFalse(PageStatus.SUBMITTED.is_draft())
		self.assertTrue(PageStatus.SUBMITTED.is_submitted())
		self.assertFalse(PageStatus.SUBMITTED.is_cancelled())

	def test_cancelled(self):
		self.assertEqual(PageStatus(2), PageStatus.CANCELLED)

		self.assertFalse(PageStatus.CANCELLED.is_draft())
		self.assertFalse(PageStatus.CANCELLED.is_submitted())
		self.assertTrue(PageStatus.CANCELLED.is_cancelled())
