From 56f1a7d537bbf8a97125554a8074633023ed1a1b Mon Sep 17 00:00:00 2001 From: Baptiste GAILLET Date: Mon, 23 May 2016 09:18:03 +0200 Subject: [PATCH] Add initial tests for organizations --- mayan/apps/organizations/tests/__init__.py | 0 mayan/apps/organizations/tests/literals.py | 4 ++++ mayan/apps/organizations/tests/test_models.py | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 mayan/apps/organizations/tests/__init__.py create mode 100644 mayan/apps/organizations/tests/literals.py create mode 100644 mayan/apps/organizations/tests/test_models.py diff --git a/mayan/apps/organizations/tests/__init__.py b/mayan/apps/organizations/tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mayan/apps/organizations/tests/literals.py b/mayan/apps/organizations/tests/literals.py new file mode 100644 index 0000000000..fb73a7fb44 --- /dev/null +++ b/mayan/apps/organizations/tests/literals.py @@ -0,0 +1,4 @@ +from __future__ import absolute_import, unicode_literals + +TEST_ORGANIZATION_LABEL = 'test organization label' +TEST_ORGANIZATION_EDITED_LABEL = 'test organization edited label' diff --git a/mayan/apps/organizations/tests/test_models.py b/mayan/apps/organizations/tests/test_models.py new file mode 100644 index 0000000000..56438d6bd5 --- /dev/null +++ b/mayan/apps/organizations/tests/test_models.py @@ -0,0 +1,19 @@ +from __future__ import unicode_literals + +from django.test import TestCase + +from ..models import Organization + +from .literals import TEST_ORGANIZATION_LABEL, TEST_ORGANIZATION_EDITED_LABEL + + +class OrganizationTestCase(TestCase): + def setUp(self): + self.organization = Organization.objects.create( + label=TEST_ORGANIZATION_LABEL + ) + + def test_basic(self): + queryset = Organization.objects.get_for_now() + + self.assertEqual(queryset.exists(), True)