aboutsummaryrefslogtreecommitdiffstats
path: root/servo/tests/test_models.py
diff options
context:
space:
mode:
Diffstat (limited to 'servo/tests/test_models.py')
-rw-r--r--servo/tests/test_models.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/servo/tests/test_models.py b/servo/tests/test_models.py
new file mode 100644
index 0000000..263834a
--- /dev/null
+++ b/servo/tests/test_models.py
@@ -0,0 +1,29 @@
+# -*- coding: utf-8 -*-
+
+import unittest
+from django.test import TestCase
+
+from servo.models.common import Configuration
+from servo.models.order import Order
+from servo.models.account import User
+
+
+class ConfigurationTests(TestCase):
+ def test_checkin_user(self):
+ uid = Configuration.conf('checkin_user')
+ u = User.objects.get(pk=uid)
+ self.assertEquals(u.pk, int(uid))
+
+
+class ServiceOrderTests(TestCase):
+ def test_checkin(self):
+ uid = Configuration.conf('checkin_user')
+ u = User.objects.get(pk=uid)
+ o = Order(created_by=u)
+ o.save()
+ o.check_in(u)
+ self.assertEquals(o.location, o.checkin_location)
+
+
+if __name__ == '__main__':
+ unittest.main()