Renaming MapablePoint
This commit is contained in:
parent
79ed029db0
commit
12881d9345
@ -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.).
|
||||
"""
|
||||
|
@ -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(
|
||||
|
@ -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))
|
||||
)
|
||||
)
|
||||
|
@ -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'])
|
||||
|
Loading…
Reference in New Issue
Block a user