From 101e003327a74228cdbeb61278f8841bfdca948e Mon Sep 17 00:00:00 2001
From: Bryan Brancotte <bryan.brancotte@pasteur.fr>
Date: Wed, 27 Mar 2019 12:50:21 +0100
Subject: [PATCH] Testing presence of sub-templates

---
 basetheme_bootstrap/tests.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/basetheme_bootstrap/tests.py b/basetheme_bootstrap/tests.py
index 75ea8df..8d14e70 100644
--- a/basetheme_bootstrap/tests.py
+++ b/basetheme_bootstrap/tests.py
@@ -1,3 +1,5 @@
+import os
+
 from django.conf import settings
 from django.contrib.auth import get_user_model
 from django.core.cache import cache
@@ -37,6 +39,26 @@ class SignUpTests(TestCase):
         self.assertEqual(get_user_model().objects.count(), user_count + 1)
 
 
+class TestWithTemplatesInPlace(SignUpTests):
+
+    def setUp(self):
+        super().setUp()
+
+    def test_with_templates(self):
+        templates = [
+            "test_app_1/templates/test_app_1/fork_me.html",
+            "test_app_1/templates/test_app_1/nav_bar.html",
+            "test_app_1/templates/test_app_1/last_update.html",
+        ]
+
+        for t in templates:
+            open(t, 'a').close()
+        self.test_works()
+        self.test_sign_up_form_view()
+        for t in templates:
+            os.remove(t)
+
+
 class SuperuserSignUpTests(TestCase):
 
     def setUp(self):
-- 
GitLab