Commit d72a2264 authored by Claude Paroz's avatar Claude Paroz

Create a TestModuleBase class to setup testmodule as test module

parent 44876305
......@@ -438,9 +438,10 @@ class ModuleTestCase(TestCase):
@override_settings(SCRATCHDIR=str(Path(__file__).parent))
class DomainTests(TestCase):
class TestModuleBase(TestCase):
@classmethod
def setUpTestData(cls):
super().setUpTestData()
Branch.checkout_on_creation = False
Branch.checkout = mocked_checkout
cls.mod = Module.objects.create(
......@@ -450,6 +451,8 @@ class DomainTests(TestCase):
cls.branch = Branch(module=cls.mod, name="master")
cls.branch.save(update_statistics=False)
class DomainTests(TestModuleBase):
def setUp(self):
super().setUp()
Domain.doc_format.cache_clear()
......@@ -730,16 +733,7 @@ class FigureTests(TestCase):
self.assertTrue(errs[0][1].startswith("Figures should not be copied"))
@override_settings(SCRATCHDIR=str(Path(__file__).parent))
class UtilsTests(TestCase):
@classmethod
def setUpTestData(self):
Branch.checkout_on_creation = False
Branch.checkout = mocked_checkout
self.mod = Module.objects.create(name="testmodule", vcs_type='git')
self.branch = Branch(module=self.mod, name="master")
self.branch.save(update_statistics=False)
class UtilsTests(TestModuleBase):
def test_read_makefile_variable(self):
domain = Domain.objects.create(
module=self.mod, name='help', dtype='doc', layout='help_docbook/{lang}/{lang}.po'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment