1 | from zope.interface.verify import verifyClass |
---|
2 | from Testing.ZopeTestCase.PortalTestCase import user_name, user_password |
---|
3 | |
---|
4 | from Products.CMFCore.utils import getToolByName |
---|
5 | |
---|
6 | from geo.interfaces import IPoint |
---|
7 | from Products.geolocation.interfaces.geolocation import IPointView |
---|
8 | from Products.geolocation.interfaces.geomap import IGEOMap, IGEOMapView |
---|
9 | from Products.geolocation.adapters.geolocation import Point |
---|
10 | from Products.geolocation.adapters.geomap import GEOMap |
---|
11 | from Products.geolocation.browser.location import PointView |
---|
12 | from Products.geolocation.browser.map import GEOMapView |
---|
13 | |
---|
14 | from Products.PloneTestCase import PloneTestCase |
---|
15 | |
---|
16 | PRODUCTS=('geolocation',) |
---|
17 | |
---|
18 | map(PloneTestCase.installProduct, PRODUCTS) |
---|
19 | PloneTestCase.setupPloneSite(products=PRODUCTS) |
---|
20 | |
---|
21 | PRODUCT = 'geolocation' |
---|
22 | |
---|
23 | def maps_login(self, role): |
---|
24 | """ Utility method for login under required role """ |
---|
25 | from Testing.ZopeTestCase.PortalTestCase import user_name, user_password |
---|
26 | if role == 'manager': |
---|
27 | self.loginAsPortalOwner() |
---|
28 | elif role == 'member': |
---|
29 | self.login(user_name) |
---|
30 | elif role == 'another_member': |
---|
31 | self.login('another_member') |
---|
32 | elif role == 'anonym': |
---|
33 | self.logout() |
---|
34 | |
---|
35 | # Installation testing stuff |
---|
36 | PORTAL_TYPES = ['Document', 'News Item', 'Event', 'Link', 'Image'] |
---|
37 | GEO_INDEX = 'geoLocation' |
---|
38 | LATITUDE = 2.3 |
---|
39 | LONGITUDE = 3.2 |
---|
40 | ALTITUDE = 2.1 |
---|
41 | MAP_CENTER = (9,9) |
---|
42 | MAP_ZOOM = 6 |
---|
43 | MAP_TYPE = 'hybrid' |
---|