<NME> __init__.py
<BEF>     from django.utils import unittest

    def override_settings(*args, **kwargs):
        return unittest.skip("overriding settings is not supported by this django version")

from easy_maps.models import Address

    def test_empty_dont_save_on_db(self):
        # If we pass an empty address we don't save nothing in the
        # database
        html = """{%% load easy_maps_tags %%}{%% easy_map '%(varname)s' 500 500 10 %%}"""
    
        before_count = len(Address.objects.all())

        t = template.Template(html % {"varname": ""})
        t.render(template.Context({}))

        after_count = len(Address.objects.all())

    # @override_settings(EASY_MAPS_CENTER=fake_default_center)
    # def test_empty_address_use_defaults(self):
    #     # When an empty address is passed uses the EASY_MAPS_CENTER setting
    #     html = """{%% load easy_maps_tags %%}{%% easy_map '%(varname)s' 500 500 10 %%}"""

    #     address = [None]  # nonlocal

    #     # below we patch the render_to_string in order to retrieve the map
    #     # context variable and check its coordinate
    #     def get_map_context_instance(*args, **kwargs):
    #         address[0] = kwargs['context_instance']['map']
    #         return ''

    #     t = template.Template(html % {"varname": ""})
    #     with mock.patch('easy_maps.templatetags.easy_maps_tags.render_to_string', get_map_context_instance):
    #         t.render(template.Context({}))

    #     self.assertEqual(address[0].latitude, AddressTests.fake_default_center[0])
    #     self.assertEqual(address[0].longitude, AddressTests.fake_default_center[1])

    @override_settings(EASY_MAPS_CENTER=fake_default_center)
    def test_normal_address(self):
        # If we pass an address don't use the defaults
        html = """{%% load easy_maps_tags %%}{%% easy_map '%(varname)s' 500 500 10 %%}"""

        before = len(Address.objects.all())

        a = "Ekaterinburg, Mira 33"
        
        t = template.Template(html % {"varname": a})
        t.render(template.Context({}))

        address = Address.objects.get(address=a)

        self.assertNotEqual(address.latitude, AddressTests.fake_default_center[0])
        self.assertNotEqual(address.longitude, AddressTests.fake_default_center[1])

        after = len(Address.objects.all())


    @override_settings(EASY_MAPS_CENTER=fake_default_center)
    def test_use_address_instance(self):
        # It's possible to pass directly to the easy_map tag an Address instance.
        # This test checks also that the database is not hit.
        html = """{%% load easy_maps_tags %%}{%% easy_map %(varname)s 500 500 10 %%}"""

        # create a fake address
        a = Address.objects.create(address='fake')

        before = len(Address.objects.all())

        t = template.Template(html % {'varname': 'address'})
        ctx = template.Context({'varname': a})

        self.assertNumQueries(0, lambda: t.render(ctx))


<MSG> pep8 cleanup

<DFF> @@ -11,7 +11,8 @@ except ImportError:
     from django.utils import unittest
 
     def override_settings(*args, **kwargs):
-        return unittest.skip("overriding settings is not supported by this django version")
+        return unittest.skip(
+            "overriding settings is not supported by this django version")
 
 from easy_maps.models import Address
 
@@ -22,11 +23,11 @@ class AddressTests(TestCase):
     def test_empty_dont_save_on_db(self):
         # If we pass an empty address we don't save nothing in the
         # database
-        html = """{%% load easy_maps_tags %%}{%% easy_map '%(varname)s' 500 500 10 %%}"""
-    
+        html = "{%% load easy_maps_tags %%}{%% easy_map '%(v)s' 500 500 10 %%}"
+
         before_count = len(Address.objects.all())
 
-        t = template.Template(html % {"varname": ""})
+        t = template.Template(html % {"v": ""})
         t.render(template.Context({}))
 
         after_count = len(Address.objects.all())
@@ -35,40 +36,46 @@ class AddressTests(TestCase):
 
     # @override_settings(EASY_MAPS_CENTER=fake_default_center)
     # def test_empty_address_use_defaults(self):
-    #     # When an empty address is passed uses the EASY_MAPS_CENTER setting
-    #     html = """{%% load easy_maps_tags %%}{%% easy_map '%(varname)s' 500 500 10 %%}"""
+    #     # When an empty address is passed uses the EASY_MAPS_CENTER
+    #     # setting
+    #     html = "{%% load easy_maps_tags %%}{%% easy_map '%(v)s' 500 500 10 %%}"
 
     #     address = [None]  # nonlocal
 
-    #     # below we patch the render_to_string in order to retrieve the map
-    #     # context variable and check its coordinate
+    #     # below we patch the render_to_string in order to retrieve the
+    #     # map context variable and check its coordinate
     #     def get_map_context_instance(*args, **kwargs):
     #         address[0] = kwargs['context_instance']['map']
     #         return ''
 
     #     t = template.Template(html % {"varname": ""})
-    #     with mock.patch('easy_maps.templatetags.easy_maps_tags.render_to_string', get_map_context_instance):
+    #     with mock.patch(
+    #             'easy_maps.templatetags.easy_maps_tags.render_to_string', get_map_context_instance):
     #         t.render(template.Context({}))
 
-    #     self.assertEqual(address[0].latitude, AddressTests.fake_default_center[0])
-    #     self.assertEqual(address[0].longitude, AddressTests.fake_default_center[1])
+    #     self.assertEqual(
+    #         address[0].latitude, AddressTests.fake_default_center[0])
+    #     self.assertEqual(
+    #         address[0].longitude, AddressTests.fake_default_center[1])
 
     @override_settings(EASY_MAPS_CENTER=fake_default_center)
     def test_normal_address(self):
         # If we pass an address don't use the defaults
-        html = """{%% load easy_maps_tags %%}{%% easy_map '%(varname)s' 500 500 10 %%}"""
+        html = "{%% load easy_maps_tags %%}{%% easy_map '%(v)s' 500 500 10 %%}"
 
         before = len(Address.objects.all())
 
         a = "Ekaterinburg, Mira 33"
-        
-        t = template.Template(html % {"varname": a})
+
+        t = template.Template(html % {"v": a})
         t.render(template.Context({}))
 
         address = Address.objects.get(address=a)
 
-        self.assertNotEqual(address.latitude, AddressTests.fake_default_center[0])
-        self.assertNotEqual(address.longitude, AddressTests.fake_default_center[1])
+        self.assertNotEqual(
+            address.latitude, AddressTests.fake_default_center[0])
+        self.assertNotEqual(
+            address.longitude, AddressTests.fake_default_center[1])
 
         after = len(Address.objects.all())
 
@@ -76,17 +83,18 @@ class AddressTests(TestCase):
 
     @override_settings(EASY_MAPS_CENTER=fake_default_center)
     def test_use_address_instance(self):
-        # It's possible to pass directly to the easy_map tag an Address instance.
-        # This test checks also that the database is not hit.
-        html = """{%% load easy_maps_tags %%}{%% easy_map %(varname)s 500 500 10 %%}"""
+        # It's possible to pass directly to the easy_map tag an
+        # Address instance.  This test checks also that the database
+        # is not hit.
+        html = "{%% load easy_maps_tags %%}{%% easy_map %(v)s 500 500 10 %%}"
 
         # create a fake address
         a = Address.objects.create(address='fake')
 
         before = len(Address.objects.all())
 
-        t = template.Template(html % {'varname': 'address'})
-        ctx = template.Context({'varname': a})
+        t = template.Template(html % {'v': 'address'})
+        ctx = template.Context({'v': a})
 
         self.assertNumQueries(0, lambda: t.render(ctx))
 

pep8 cleanup