Test fixes

This commit is contained in:
2020-09-12 10:08:47 +01:00
parent ba6dbc6980
commit cf7ada3d9e
5 changed files with 23 additions and 22 deletions

View File

@@ -174,7 +174,7 @@ class Command(BaseCommand):
"add_person", "change_person", "view_person", "view_profile", "add_person", "change_person", "view_person", "view_profile",
"add_venue", "change_venue", "view_venue", "add_venue", "change_venue", "view_venue",
"add_asset", "change_asset", "delete_asset", "add_asset", "change_asset", "delete_asset",
"asset_finance", "view_asset", "view_supplier", "asset_finance", "view_asset", "view_supplier", "asset_finance",
"add_supplier", "view_cabletype", "change_cabletype", "add_supplier", "view_cabletype", "change_cabletype",
"add_cabletype", "view_eventchecklist", "change_eventchecklist", "add_cabletype", "view_eventchecklist", "change_eventchecklist",
"add_eventchecklist", "view_riskassessment", "change_riskassessment", "add_eventchecklist", "view_riskassessment", "change_riskassessment",

View File

@@ -0,0 +1,21 @@
# Generated by Django 3.1 on 2020-09-12 08:03
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('RIGS', '0054_auto_20200831_1218'),
]
operations = [
migrations.AlterModelOptions(
name='eventchecklist',
options={'ordering': ['event'], 'permissions': [('review_eventchecklist', 'Can review Event Checklists')]},
),
migrations.AlterModelOptions(
name='riskassessment',
options={'ordering': ['event'], 'permissions': [('review_riskassessment', 'Can review Risk Assessments')]},
),
]

View File

@@ -152,18 +152,6 @@ def profile_by_index(value):
return "" return ""
@register.filter
def next(alist, current_index):
"""
Returns the next element of the list using the current index if it exists.
Otherwise returns an empty string.
"""
try:
return alist[int(current_index) + 1] # access the next element
except BaseException:
return '' # return empty string in case of exception
@register.filter(needs_autoescape=True) @register.filter(needs_autoescape=True)
def yesnoi(boolean, invert=False, autoescape=True): def yesnoi(boolean, invert=False, autoescape=True):
value = title(yesno(boolean)) value = title(yesno(boolean))

View File

@@ -716,7 +716,6 @@ class TestCalendar(BaseRigboardTest):
# Wow - that was a lot of tests # Wow - that was a lot of tests
@screenshot_failure_cls
class ClientEventAuthorisationTest(TestCase): class ClientEventAuthorisationTest(TestCase):
auth_data = { auth_data = {
'name': 'Test ABC', 'name': 'Test ABC',

View File

@@ -17,6 +17,7 @@ from PyRIGS.tests.base import animation_is_finished
import datetime import datetime
from django.utils import timezone from django.utils import timezone
from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.action_chains import ActionChains
from django.test import tag
@screenshot_failure_cls @screenshot_failure_cls
@@ -346,7 +347,6 @@ class TestAssetAudit(AutoLoginTest):
self.assertIn("Asset with that ID does not exist!", self.page.error.text) self.assertIn("Asset with that ID does not exist!", self.page.error.text)
@screenshot_failure_cls
class TestSupplierValidation(TestCase): class TestSupplierValidation(TestCase):
@classmethod @classmethod
def setUpTestData(cls): def setUpTestData(cls):
@@ -369,7 +369,6 @@ class TestSupplierValidation(TestCase):
self.assertFormError(response, 'form', 'name', 'This field is required.') self.assertFormError(response, 'form', 'name', 'This field is required.')
@screenshot_failure_cls
class Test404(TestCase): class Test404(TestCase):
@classmethod @classmethod
def setUpTestData(cls): def setUpTestData(cls):
@@ -388,8 +387,6 @@ class Test404(TestCase):
self.assertEqual(response.status_code, 404) self.assertEqual(response.status_code, 404)
# @tag('slow') TODO: req. Django 3.0
@screenshot_failure_cls
class TestAccessLevels(TestCase): class TestAccessLevels(TestCase):
@override_settings(DEBUG=True) @override_settings(DEBUG=True)
def setUp(self): def setUp(self):
@@ -460,7 +457,6 @@ class TestAccessLevels(TestCase):
# def test_finance_access(self): Level not used in assets currently # def test_finance_access(self): Level not used in assets currently
@screenshot_failure_cls
class TestFormValidation(TestCase): class TestFormValidation(TestCase):
@classmethod @classmethod
def setUpTestData(cls): def setUpTestData(cls):
@@ -529,7 +525,6 @@ class TestFormValidation(TestCase):
self.assertFormError(response, 'form', 'csa', 'The CSA of a cable must be more than 0') self.assertFormError(response, 'form', 'csa', 'The CSA of a cable must be more than 0')
@screenshot_failure_cls
class TestSampleDataGenerator(TestCase): class TestSampleDataGenerator(TestCase):
@override_settings(DEBUG=True) @override_settings(DEBUG=True)
def test_generate_sample_data(self): def test_generate_sample_data(self):
@@ -554,7 +549,6 @@ class TestSampleDataGenerator(TestCase):
self.assertRaisesRegex(CommandError, ".*production", call_command, 'deleteSampleData') self.assertRaisesRegex(CommandError, ".*production", call_command, 'deleteSampleData')
@screenshot_failure_cls
class TestVersioningViews(TestCase): class TestVersioningViews(TestCase):
@classmethod @classmethod
def setUpTestData(cls): def setUpTestData(cls):
@@ -598,7 +592,6 @@ class TestVersioningViews(TestCase):
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
@screenshot_failure_cls
class TestEmbeddedViews(TestCase): class TestEmbeddedViews(TestCase):
@classmethod @classmethod
def setUpTestData(cls): def setUpTestData(cls):