summaryrefslogtreecommitdiffstats
path: root/tools/pharos-dashboard/booking/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pharos-dashboard/booking/tests')
-rw-r--r--tools/pharos-dashboard/booking/tests/test_models.py7
-rw-r--r--tools/pharos-dashboard/booking/tests/test_views.py4
2 files changed, 8 insertions, 3 deletions
diff --git a/tools/pharos-dashboard/booking/tests/test_models.py b/tools/pharos-dashboard/booking/tests/test_models.py
index e933f6e8..00f6b266 100644
--- a/tools/pharos-dashboard/booking/tests/test_models.py
+++ b/tools/pharos-dashboard/booking/tests/test_models.py
@@ -6,12 +6,15 @@ from django.utils import timezone
from booking.models import Booking
from dashboard.models import Resource
+from jenkins.models import JenkinsSlave
class BookingModelTestCase(TestCase):
def setUp(self):
- self.res1 = Resource.objects.create(name='res1', slavename='s1', description='x', url='x')
- self.res2 = Resource.objects.create(name='res2', slavename='s2', description='x', url='x')
+ self.slave = JenkinsSlave.objects.create(name='test', url='test')
+
+ self.res1 = Resource.objects.create(name='res1', slave=self.slave, description='x', url='x')
+ self.res2 = Resource.objects.create(name='res2', slave=self.slave, description='x', url='x')
self.user1 = User.objects.create(username='user1')
diff --git a/tools/pharos-dashboard/booking/tests/test_views.py b/tools/pharos-dashboard/booking/tests/test_views.py
index f5b75d14..4f5ee8bd 100644
--- a/tools/pharos-dashboard/booking/tests/test_views.py
+++ b/tools/pharos-dashboard/booking/tests/test_views.py
@@ -12,12 +12,14 @@ from registration.forms import User
from account.models import UserProfile
from booking.models import Booking
from dashboard.models import Resource
+from jenkins.models import JenkinsSlave
class BookingViewTestCase(TestCase):
def setUp(self):
self.client = Client()
- self.res1 = Resource.objects.create(name='res1', slavename='s1', description='x', url='x')
+ self.slave = JenkinsSlave.objects.create(name='test', url='test')
+ self.res1 = Resource.objects.create(name='res1', slave=self.slave, description='x', url='x')
self.user1 = User.objects.create(username='user1')
self.user1.set_password('user1')
self.user1profile = UserProfile.objects.create(user=self.user1)