This commit is contained in:
2020-05-24 19:24:51 +01:00
parent 928d5cd8e6
commit c9ea1bb75d
10 changed files with 72 additions and 59 deletions

View File

@@ -7,10 +7,12 @@ import pytz
from datetime import date, time, datetime, timedelta
from django.conf import settings
def create_datetime(year, month, day, hour, min):
tz = pytz.timezone(settings.TIME_ZONE)
return tz.localize(datetime(year, month, day, hour, min)).astimezone(pytz.utc)
def create_browser():
options = webdriver.ChromeOptions()
options.add_argument("--window-size=1920,1080")

View File

@@ -149,6 +149,7 @@ class DateTimePicker(Region):
self.root.send_keys(Keys.TAB)
self.root.send_keys(time)
class SingleSelectPicker(Region):
@property
def value(self):

View File

@@ -8,7 +8,8 @@ from django.views.decorators.clickjacking import xframe_options_exempt
from django.contrib.auth.views import LoginView
from registration.backends.default.views import RegistrationView
from PyRIGS.decorators import permission_required_with_403
import RIGS, users
import RIGS
import users
from PyRIGS import views
urlpatterns = [

View File

@@ -9,6 +9,7 @@ from PyRIGS.tests.pages import BasePage, FormPage
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.support import expected_conditions as EC
class Index(BasePage):
URL_TEMPLATE = reverse('index')
@@ -75,6 +76,7 @@ class EventDetail(BasePage):
def phone(self):
return self.find_element(*self._person_panel_selector).find_element(*self._phone_selector).text
class CreateEvent(FormPage):
URL_TEMPLATE = reverse('event_create')
@@ -154,6 +156,7 @@ class CreateEvent(FormPage):
def success(self):
return '/create' not in self.driver.current_url
class DuplicateEvent(CreateEvent):
URL_TEMPLATE = 'event/{event_id}/duplicate'
_submit_locator = (By.XPATH, '/html/body/div[1]/form/div/div[5]/div/button')
@@ -162,6 +165,7 @@ class DuplicateEvent(CreateEvent):
def success(self):
return '/duplicate' not in self.driver.current_url
class EditEvent(CreateEvent):
URL_TEMPLATE = 'event/{event_id}/edit'
_submit_locator = (By.XPATH, '/html/body/div[1]/form/div/div[5]/div/button')
@@ -170,8 +174,8 @@ class EditEvent(CreateEvent):
def success(self):
return '/edit' not in self.driver.current_url
class GenericList(BasePage):
_search_selector = (By.CSS_SELECTOR, 'div.input-group:nth-child(2) > input:nth-child(1)')
_search_go_selector = (By.ID, 'id_search')
_add_item_selector = (By.CSS_SELECTOR, '.btn-success')

View File

@@ -28,6 +28,7 @@ from django.conf import settings
import sys
class IcalTest(LiveServerTestCase):
def setUp(self):
self.all_events = set(range(1, 18))
@@ -415,6 +416,7 @@ class TECEventAuthorisationTest(TestCase):
self.assertEqual(self.event.auth_request_to, 'client@functional.test')
self.assertIsNotNone(self.event.auth_request_at)
class SearchTest(LiveServerTestCase):
def setUp(self):
self.profile = models.Profile(

View File

@@ -20,6 +20,7 @@ from django.utils import timezone
from selenium.webdriver.common.action_chains import ActionChains
from django.db import transaction
class BaseRigboardTest(AutoLoginTest):
def setUp(self):
self.vatrate = models.VatRate.objects.create(start_at='2014-03-05', rate=0.20, comment='test1')
@@ -58,6 +59,7 @@ class BaseRigboardTest(AutoLoginTest):
self.wait.until(animation_is_finished())
self.assertTrue(self.page.is_expanded)
class TestRigboard(BaseRigboardTest):
def setUp(self):
super().setUp()

View File

@@ -300,6 +300,7 @@ class ActivityTable(versioning.ActivityTable):
return context
class CableTypeList(generic.ListView):
model = models.CableType
template_name = 'cable_type_list.html'

View File

@@ -185,4 +185,3 @@ class UserRegistrationTest(LiveServerTestCase):
self.assertEqual(profileObject.email, 'test@example.com')
# All is well

View File

@@ -194,6 +194,8 @@ class RIGSVersionTestCase(TestCase):
self.assertTrue(diffs[0].new is None)
# Unit Tests
class TestVersioningViews(TestCase):
@classmethod
def setUpTestData(cls):
@@ -274,4 +276,3 @@ class TestVersioningViews(TestCase):
# Functional Tests