From 12881d934508300fc54fdc65a033983d1de1c18a Mon Sep 17 00:00:00 2001 From: reverend Date: Mon, 14 Sep 2020 15:18:21 +0200 Subject: [PATCH] Renaming MapablePoint --- lostplaces/lostplaces_app/models.py | 4 ++-- .../tests/models/test_abstract_models.py | 6 +++--- lostplaces/lostplaces_app/tests/views/__init__.py | 10 +++++----- .../lostplaces_app/tests/views/test_place_views.py | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lostplaces/lostplaces_app/models.py b/lostplaces/lostplaces_app/models.py index c5a9b70..049999e 100644 --- a/lostplaces/lostplaces_app/models.py +++ b/lostplaces/lostplaces_app/models.py @@ -54,7 +54,7 @@ class Taggable(models.Model): tags = TaggableManager(blank=True) -class MapablePoint(models.Model): +class Mapable(models.Model): ''' This abstract model class represents an object that can be displayed on a map. @@ -109,7 +109,7 @@ class Voucher(models.Model): return "Voucher " + str(self.code) -class Place(Submittable, Taggable, MapablePoint): +class Place(Submittable, Taggable, Mapable): """ Place defines a lost place (location, name, description etc.). """ diff --git a/lostplaces/lostplaces_app/tests/models/test_abstract_models.py b/lostplaces/lostplaces_app/tests/models/test_abstract_models.py index 27195e0..5f898ad 100644 --- a/lostplaces/lostplaces_app/tests/models/test_abstract_models.py +++ b/lostplaces/lostplaces_app/tests/models/test_abstract_models.py @@ -6,7 +6,7 @@ from django.contrib.auth.models import User from lostplaces_app.models import ( Taggable, - MapablePoint, + Mapable, Submittable ) from lostplaces_app.tests.models import ModelTestCase @@ -22,9 +22,9 @@ class TaggableTestCase(ModelTestCase): self.assertField('tags', TaggableManager) -class MapablePointTestCase(ModelTestCase): +class MapableTestCase(ModelTestCase): - model = MapablePoint + model = Mapable def test_name(self): self.assertCharField( diff --git a/lostplaces/lostplaces_app/tests/views/__init__.py b/lostplaces/lostplaces_app/tests/views/__init__.py index 17fe8f9..faceaa7 100644 --- a/lostplaces/lostplaces_app/tests/views/__init__.py +++ b/lostplaces/lostplaces_app/tests/views/__init__.py @@ -1,6 +1,6 @@ from django.test import TestCase -from lostplaces_app.models import Taggable, MapablePoint +from lostplaces_app.models import Taggable, Mapable from taggit.models import Tag @@ -165,9 +165,9 @@ class TaggableViewTestCaseMixin: msg='Expecting delete_url_name to be of type string' ) -class MapablePointViewTestCaseMixin: +class MapableViewTestCaseMixin: - def assertMapablePointContext(self, context): + def assertMapableContext(self, context): self.assertTrue( 'all_points' in context, msg='Expecting the context for mapable point to contain \'all_points\' attribute' @@ -175,9 +175,9 @@ class MapablePointViewTestCaseMixin: for point in context['all_points']: self.assertTrue( - isinstance(point, MapablePoint), + isinstance(point, Mapable), msg='Expecting all entries to be an instance of %s, got %s' % ( - str(MapablePoint), + str(Mapable), str(type(point)) ) ) diff --git a/lostplaces/lostplaces_app/tests/views/test_place_views.py b/lostplaces/lostplaces_app/tests/views/test_place_views.py index c0270d1..6913399 100644 --- a/lostplaces/lostplaces_app/tests/views/test_place_views.py +++ b/lostplaces/lostplaces_app/tests/views/test_place_views.py @@ -14,7 +14,7 @@ from lostplaces_app.forms import PlaceImageCreateForm, PlaceForm from lostplaces_app.tests.views import ( ViewTestCase, TaggableViewTestCaseMixin, - MapablePointViewTestCaseMixin + MapableViewTestCaseMixin ) @@ -83,7 +83,7 @@ class TestPlaceListView(ViewTestCase): self.assertContext(response, 'mapping_config') -class PlaceDetailViewTestCase(TaggableViewTestCaseMixin, MapablePointViewTestCaseMixin, ViewTestCase): +class PlaceDetailViewTestCase(TaggableViewTestCaseMixin, MapableViewTestCaseMixin, ViewTestCase): view = PlaceDetailView @classmethod @@ -123,4 +123,4 @@ class PlaceDetailViewTestCase(TaggableViewTestCaseMixin, MapablePointViewTestCas str(self.view) ) ) - self.assertMapablePointContext(response.context['mapping_config']) + self.assertMapableContext(response.context['mapping_config'])