aboutsummaryrefslogtreecommitdiffstats
path: root/src/booking/tests
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2020-02-06 18:34:17 +0000
committerGerrit Code Review <gerrit@opnfv.org>2020-02-06 18:34:17 +0000
commit868dc419abbec2988dfe48cbd9d6f7cf56a48079 (patch)
tree7ce55022654d3fee68ed4833888a4f15590e61ae /src/booking/tests
parent078273eb7db5a481a4131d44a943f3c9e34b6b88 (diff)
parent77377d5e9362bd35a3b300df231e82ee974675e1 (diff)
Merge "Comments and Documentation"
Diffstat (limited to 'src/booking/tests')
-rw-r--r--src/booking/tests/test_models.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/booking/tests/test_models.py b/src/booking/tests/test_models.py
index 6170295..c8c8ea8 100644
--- a/src/booking/tests/test_models.py
+++ b/src/booking/tests/test_models.py
@@ -21,10 +21,20 @@ from resource_inventory.models import ResourceBundle, GenericResourceBundle, Con
class BookingModelTestCase(TestCase):
+ """
+ Test the Booking model.
+
+ Creates all the scafolding needed and tests the Booking model
+ """
count = 0
def setUp(self):
+ """
+ Prepare for Booking model tests.
+
+ Creates all the needed models, such as users, resources, and configurations
+ """
self.owner = User.objects.create(username='owner')
self.res1 = ResourceBundle.objects.create(
@@ -52,6 +62,8 @@ class BookingModelTestCase(TestCase):
def test_start_end(self):
"""
+ Verify the start and end fields.
+
if the start of a booking is greater or equal then the end,
saving should raise a ValueException
"""
@@ -79,6 +91,8 @@ class BookingModelTestCase(TestCase):
def test_conflicts(self):
"""
+ Verify conflicting dates are dealt with.
+
saving an overlapping booking on the same resource
should raise a ValueException
saving for different resources should succeed
@@ -207,6 +221,8 @@ class BookingModelTestCase(TestCase):
def test_extensions(self):
"""
+ Test booking extensions.
+
saving a booking with an extended end time is allows to happen twice,
and each extension must be a maximum of one week long
"""