@patch('regulations.apps.get_app_template_dirs')
def test_precompute_custom_templates(self, get_app_template_dirs):
    'Verify that custom templates are found'
    get_app_template_dirs.return_value = [self.tmpdir]
    open(os.path.join(self.tmpdir, '123-45-a.html'), 'w').close()
    open(os.path.join(self.tmpdir, 'other.html'), 'w').close()
    RegulationsConfig.precompute_custom_templates()
    self.assertEqual(RegulationsConfig.custom_tpls['123-45-a'], 'regulations/custom_nodes/123-45-a.html')
    self.assertEqual(RegulationsConfig.custom_tpls['other'], 'regulations/custom_nodes/other.html')
    self.assertFalse(('another' in RegulationsConfig.custom_tpls))
Verify that custom templates are found
@patch('regulations.apps.get_app_template_dirs')
def test_precompute_custom_templates(self, get_app_template_dirs):
    
    get_app_template_dirs.return_value = [self.tmpdir]
    open(os.path.join(self.tmpdir, '123-45-a.html'), 'w').close()
    open(os.path.join(self.tmpdir, 'other.html'), 'w').close()
    RegulationsConfig.precompute_custom_templates()
    self.assertEqual(RegulationsConfig.custom_tpls['123-45-a'], 'regulations/custom_nodes/123-45-a.html')
    self.assertEqual(RegulationsConfig.custom_tpls['other'], 'regulations/custom_nodes/other.html')
    self.assertFalse(('another' in RegulationsConfig.custom_tpls))