Merge remote-tracking branch 'origin/bs4' into bs4

This commit is contained in:
2020-05-27 04:26:15 +02:00
6 changed files with 67 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ from django.test.utils import override_settings
from django.urls import reverse
from urllib.parse import urlparse
from RIGS import models as rigsmodels
from PyRIGS.tests.base import BaseTest, AutoLoginTest
from PyRIGS.tests.base import BaseTest, AutoLoginTest, screenshot_failure_cls
from assets import models, urls
from reversion import revisions as reversion
from selenium.webdriver.support import expected_conditions as EC
@@ -18,6 +18,7 @@ import datetime
from django.utils import timezone
@screenshot_failure_cls
class TestAssetList(AutoLoginTest):
def setUp(self):
super().setUp()
@@ -95,6 +96,7 @@ class TestAssetList(AutoLoginTest):
self.assertEqual("10", assetIDs[1])
@screenshot_failure_cls
class TestAssetForm(AutoLoginTest):
def setUp(self):
super().setUp()
@@ -202,6 +204,7 @@ class TestAssetForm(AutoLoginTest):
self.assertEqual(models.Asset.objects.last().description, self.parent.description)
@screenshot_failure_cls
class TestSupplierList(AutoLoginTest):
def setUp(self):
super().setUp()
@@ -241,6 +244,7 @@ class TestSupplierList(AutoLoginTest):
self.assertTrue(len(self.page.suppliers) == 0)
@screenshot_failure_cls
class TestSupplierCreateAndEdit(AutoLoginTest):
def setUp(self):
super().setUp()
@@ -268,6 +272,7 @@ class TestSupplierCreateAndEdit(AutoLoginTest):
self.assertTrue(self.page.success)
@screenshot_failure_cls
class TestAssetAudit(AutoLoginTest):
def setUp(self):
super().setUp()
@@ -338,6 +343,7 @@ class TestAssetAudit(AutoLoginTest):
self.assertIn("Asset with that ID does not exist!", self.page.error.text)
@screenshot_failure_cls
class TestSupplierValidation(TestCase):
@classmethod
def setUpTestData(cls):
@@ -360,6 +366,7 @@ class TestSupplierValidation(TestCase):
self.assertFormError(response, 'form', 'name', 'This field is required.')
@screenshot_failure_cls
class Test404(TestCase):
@classmethod
def setUpTestData(cls):
@@ -379,6 +386,7 @@ class Test404(TestCase):
# @tag('slow') TODO: req. Django 3.0
@screenshot_failure_cls
class TestAccessLevels(TestCase):
@override_settings(DEBUG=True)
def setUp(self):
@@ -449,6 +457,7 @@ class TestAccessLevels(TestCase):
# def test_finance_access(self): Level not used in assets currently
@screenshot_failure_cls
class TestFormValidation(TestCase):
@classmethod
def setUpTestData(cls):
@@ -517,6 +526,7 @@ class TestFormValidation(TestCase):
self.assertFormError(response, 'form', 'csa', 'The CSA of a cable must be more than 0')
@screenshot_failure_cls
class TestSampleDataGenerator(TestCase):
@override_settings(DEBUG=True)
def test_generate_sample_data(self):
@@ -541,6 +551,7 @@ class TestSampleDataGenerator(TestCase):
self.assertRaisesRegex(CommandError, ".*production", call_command, 'deleteSampleData')
@screenshot_failure_cls
class TestVersioningViews(TestCase):
@classmethod
def setUpTestData(cls):
@@ -584,6 +595,7 @@ class TestVersioningViews(TestCase):
self.assertEqual(response.status_code, 200)
@screenshot_failure_cls
class TestEmbeddedViews(TestCase):
@classmethod
def setUpTestData(cls):