diff --git a/django/test/utils.py b/django/test/utils.py
index 619f9cd..a79b9f3 100644
--- a/django/test/utils.py
+++ b/django/test/utils.py
@@ -541,3 +541,13 @@ def captured_stdin():
        self.assertEqual(captured, "hello")
     """
     return captured_output("stdin")
+
+
+def reset_warning_registry(pattern=".*"):
+    """clear warning registry for all match modules.
+    This fixes unpexpected behavior from tests when running
+    with --reverse option"""
+    key = "__warningregistry__"
+    for mod in sys.modules.values():
+        if hasattr(mod, key) and re.match(pattern, mod.__name__):
+            getattr(mod, key).clear()
diff --git a/tests/cache/tests.py b/tests/cache/tests.py
index e3ad724..5140a73 100644
--- a/tests/cache/tests.py
+++ b/tests/cache/tests.py
@@ -1237,6 +1237,8 @@ class GetCacheTests(IgnoreDeprecationWarningsMixin, TestCase):
 
     def test_close(self):
         from django.core import signals
+        from django.core.cache import get_cache
+        cache = get_cache('cache.closeable_cache.CacheClass')
         self.assertFalse(cache.closed)
         signals.request_finished.send(self.__class__)
         self.assertTrue(cache.closed)
@@ -1378,9 +1380,9 @@ class CacheUtils(TestCase):
     def test_get_cache_key(self):
         request = self.factory.get(self.path)
         response = HttpResponse()
-        key_prefix = 'localprefix'
         # Expect None if no headers have been set yet.
-        self.assertIsNone(get_cache_key(request))
+        # it was missing the response parameter.
+        self.assertIsNone(get_cache_key(request, response))
         # Set headers to an empty list.
         learn_cache_key(request, response)
 
@@ -1390,6 +1392,7 @@ class CacheUtils(TestCase):
             '18a03f9c9649f7d684af5db3524f5c99.d41d8cd98f00b204e9800998ecf8427e'
         )
         # Verify that a specified key_prefix is taken into account.
+        key_prefix = 'localprefix'
         learn_cache_key(request, response, key_prefix=key_prefix)
         self.assertEqual(
             get_cache_key(request, key_prefix=key_prefix),
diff --git a/tests/deprecation/tests.py b/tests/deprecation/tests.py
index 79a6284..e0fbe12 100644
--- a/tests/deprecation/tests.py
+++ b/tests/deprecation/tests.py
@@ -5,6 +5,7 @@ import unittest
 import warnings
 
 from django.test import SimpleTestCase, RequestFactory, override_settings
+from django.test.utils import reset_warning_registry
 from django.utils import six, translation
 from django.utils.deprecation import RenameMethodsBase
 from django.utils.encoding import force_text
@@ -23,6 +24,10 @@ class RenameMethodsTests(SimpleTestCase):
     to `get_queryset` across the code base following #15363.
     """
 
+    def setUp(self):
+        super(RenameMethodsTests, self).setUp()
+        reset_warning_registry()
+
     def test_class_definition_warnings(self):
         """
         Ensure a warning is raised upon class definition to suggest renaming
diff --git a/tests/mail/tests.py b/tests/mail/tests.py
index e4b5689..6173ea5 100644
--- a/tests/mail/tests.py
+++ b/tests/mail/tests.py
@@ -966,19 +966,6 @@ class SMTPBackendTests(BaseEmailBackendTests, SimpleTestCase):
         backend.close()
         self.assertTrue(opened)
 
-    def test_server_stopped(self):
-        """
-        Test that closing the backend while the SMTP server is stopped doesn't
-        raise an exception.
-        """
-        backend = smtp.EmailBackend(username='', password='')
-        backend.open()
-        self.server.stop()
-        try:
-            backend.close()
-        except Exception as e:
-            self.fail("close() unexpectedly raised an exception: %s" % e)
-
     @override_settings(EMAIL_USE_TLS=True)
     def test_email_tls_use_settings(self):
         backend = smtp.EmailBackend()
@@ -1110,3 +1097,36 @@ class SMTPBackendTests(BaseEmailBackendTests, SimpleTestCase):
 
         finally:
             SMTP.send = send
+
+
+class SMTPBackendStoppedServerTest(SimpleTestCase):
+    email_backend = 'django.core.mail.backends.smtp.EmailBackend'
+
+    @classmethod
+    def setUpClass(cls):
+        super(SMTPBackendStoppedTest, cls).setUpClass()
+        cls.server = FakeSMTPServer(('127.0.0.1', 0), None)
+        cls._settings_override = override_settings(
+            EMAIL_HOST="127.0.0.1",
+            EMAIL_PORT=cls.server.socket.getsockname()[1])
+        cls._settings_override.enable()
+        cls.server.start()
+
+    @classmethod
+    def tearDownClass(cls):
+        cls._settings_override.disable()
+        cls.server.stop()
+        super(SMTPBackendStoppedTest, cls).tearDownClass()
+
+    def test_server_stopped(self):
+        """
+        Test that closing the backend while the SMTP server is stopped doesn't
+        raise an exception.
+        """
+        backend = smtp.EmailBackend(username='', password='')
+        backend.open()
+        self.server.stop()
+        try:
+            backend.close()
+        except Exception as e:
+            self.fail("close() unexpectedly raised an exception: %s" % e)
diff --git a/tests/modeladmin/tests.py b/tests/modeladmin/tests.py
index 93cb58a..9085f68 100644
--- a/tests/modeladmin/tests.py
+++ b/tests/modeladmin/tests.py
@@ -1546,6 +1546,14 @@ class ListDisplayEditableTests(CheckTestCase):
 
 class ModelAdminPermissionTests(TestCase):
 
+    def setUp(self):
+        """
+        When running tests with --reverse, the last test changes the app label,
+        what interferes with the following results
+        """
+        self.model_admin = ModelAdmin(Band, AdminSite())
+        self.model_admin.opts.app_label = 'modeladmin'
+
     class MockUser(object):
         def has_module_perms(self, app_label):
             if app_label == "modeladmin":
@@ -1575,60 +1583,56 @@ class ModelAdminPermissionTests(TestCase):
         Ensure that has_add_permission returns True for users who can add
         objects and False for users who can't.
         """
-        ma = ModelAdmin(Band, AdminSite())
         request = MockRequest()
         request.user = self.MockAddUser()
-        self.assertTrue(ma.has_add_permission(request))
+        self.assertTrue(self.model_admin.has_add_permission(request))
         request.user = self.MockChangeUser()
-        self.assertFalse(ma.has_add_permission(request))
+        self.assertFalse(self.model_admin.has_add_permission(request))
         request.user = self.MockDeleteUser()
-        self.assertFalse(ma.has_add_permission(request))
+        self.assertFalse(self.model_admin.has_add_permission(request))
 
     def test_has_change_permission(self):
         """
         Ensure that has_change_permission returns True for users who can edit
         objects and False for users who can't.
         """
-        ma = ModelAdmin(Band, AdminSite())
         request = MockRequest()
         request.user = self.MockAddUser()
-        self.assertFalse(ma.has_change_permission(request))
+        self.assertFalse(self.model_admin.has_change_permission(request))
         request.user = self.MockChangeUser()
-        self.assertTrue(ma.has_change_permission(request))
+        self.assertTrue(self.model_admin.has_change_permission(request))
         request.user = self.MockDeleteUser()
-        self.assertFalse(ma.has_change_permission(request))
+        self.assertFalse(self.model_admin.has_change_permission(request))
 
     def test_has_delete_permission(self):
         """
         Ensure that has_delete_permission returns True for users who can delete
         objects and False for users who can't.
         """
-        ma = ModelAdmin(Band, AdminSite())
         request = MockRequest()
         request.user = self.MockAddUser()
-        self.assertFalse(ma.has_delete_permission(request))
+        self.assertFalse(self.model_admin.has_delete_permission(request))
         request.user = self.MockChangeUser()
-        self.assertFalse(ma.has_delete_permission(request))
+        self.assertFalse(self.model_admin.has_delete_permission(request))
         request.user = self.MockDeleteUser()
-        self.assertTrue(ma.has_delete_permission(request))
+        self.assertTrue(self.model_admin.has_delete_permission(request))
 
     def test_has_module_permission(self):
         """
         Ensure that has_module_permission returns True for users who have any
         permission for the module and False for users who don't.
         """
-        ma = ModelAdmin(Band, AdminSite())
         request = MockRequest()
         request.user = self.MockAddUser()
-        self.assertTrue(ma.has_module_permission(request))
+        self.assertTrue(self.model_admin.has_module_permission(request))
         request.user = self.MockChangeUser()
-        self.assertTrue(ma.has_module_permission(request))
+        self.assertTrue(self.model_admin.has_module_permission(request))
         request.user = self.MockDeleteUser()
-        self.assertTrue(ma.has_module_permission(request))
-        ma.opts.app_label = "anotherapp"
+        self.assertTrue(self.model_admin.has_module_permission(request))
+        self.model_admin.opts.app_label = 'anotherapp'
         request.user = self.MockAddUser()
-        self.assertFalse(ma.has_module_permission(request))
+        self.assertFalse(self.model_admin.has_module_permission(request))
         request.user = self.MockChangeUser()
-        self.assertFalse(ma.has_module_permission(request))
+        self.assertFalse(self.model_admin.has_module_permission(request))
         request.user = self.MockDeleteUser()
-        self.assertFalse(ma.has_module_permission(request))
+        self.assertFalse(self.model_admin.has_module_permission(request))
diff --git a/tests/utils_tests/test_text.py b/tests/utils_tests/test_text.py
index 4ef3031..a43870f 100644
--- a/tests/utils_tests/test_text.py
+++ b/tests/utils_tests/test_text.py
@@ -5,6 +5,7 @@ from unittest import skipUnless
 import warnings
 
 from django.test import SimpleTestCase
+from django.test.utils import reset_warning_registry
 from django.utils import six, text
 from django.utils.deprecation import RemovedInDjango19Warning
 from django.utils.encoding import force_text
@@ -18,6 +19,10 @@ IS_WIDE_BUILD = (len('\U0001F4A9') == 1)
 
 class TestUtilsText(SimpleTestCase):
 
+    def setUp(self):
+        super(TestUtilsText, self).setUp()
+        reset_warning_registry()
+
     def test_get_text_list(self):
         self.assertEqual(text.get_text_list(['a', 'b', 'c', 'd']), 'a, b, c or d')
         self.assertEqual(text.get_text_list(['a', 'b', 'c'], 'and'), 'a, b and c')
