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 Products.geolocation.interfaces.geolocation import IGEOLocated, IGEOLocatedView |
---|
7 | from Products.geolocation.interfaces.geomap import IGEOMap, IGEOMapView |
---|
8 | from Products.geolocation.adapters.geolocation import GEOLocated |
---|
9 | from Products.geolocation.adapters.geomap import GEOMap |
---|
10 | from Products.geolocation.browser.location import GEOLocatedView |
---|
11 | from Products.geolocation.browser.map import GEOMapView |
---|
12 | |
---|
13 | from Products.PloneTestCase import PloneTestCase |
---|
14 | |
---|
15 | PRODUCTS=('geolocation',) |
---|
16 | |
---|
17 | map(PloneTestCase.installProduct, PRODUCTS) |
---|
18 | PloneTestCase.setupPloneSite(products=PRODUCTS) |
---|
19 | |
---|
20 | PRODUCT = 'geolocation' |
---|
21 | |
---|
22 | def maps_login(self, role): |
---|
23 | """ Utility method for login under required role """ |
---|
24 | from Testing.ZopeTestCase.PortalTestCase import user_name, user_password |
---|
25 | if role == 'manager': |
---|
26 | self.loginAsPortalOwner() |
---|
27 | elif role == 'member': |
---|
28 | self.login(user_name) |
---|
29 | elif role == 'another_member': |
---|
30 | self.login('another_member') |
---|
31 | elif role == 'anonym': |
---|
32 | self.logout() |
---|
33 | |
---|
34 | # Installation testing stuff |
---|
35 | PORTAL_TYPES = ['Document', 'News Item', 'Event', 'Link', 'Image'] |
---|
36 | GEO_INDEX = 'geoLocation' |
---|
37 | LATITUDE = 2.3 |
---|
38 | LONGITUDE = 3.2 |
---|
39 | MAP_CENTER = (9,9) |
---|
40 | MAP_ZOOM = 6 |
---|
41 | MAP_TYPE = 'hybrid' |
---|