示例#1
0
    def setUp(self):
        self.user = UserFactory(password='******')
        perm = Permission.objects.get_by_natural_key('add_report', 'feedback', 'report')
        self.user.user_permissions.add(perm)

        self.login_url = smart_urljoin(self.live_server_url, '/login/')
        self.session = requests.Session()
示例#2
0
 def setUp(self):
     super(ListCategoriesTest, self).setUp()
     self.cat = feedback_factories.ReportCategoryFactory.build()
     self.cat.category_it = 'Obstaculo'
     self.cat.save()
     self.categories_url = smart_urljoin(self.live_server_url,
                                         '/api/feedback/categories.json')
     self.login()
示例#3
0
    def setUp(self):
        self.user = UserFactory(password='******')
        perm = Permission.objects.get_by_natural_key('add_report', 'feedback',
                                                     'report')
        self.user.user_permissions.add(perm)

        self.login_url = smart_urljoin(self.live_server_url, '/login/')
        self.session = requests.Session()
示例#4
0
 def setUp(self):
     super(ListCategoriesTest, self).setUp()
     self.cat = feedback_factories.ReportCategoryFactory.build()
     self.cat.category_it = 'Obstaculo'
     self.cat.save()
     self.categories_url = smart_urljoin(self.live_server_url,
                                         '/api/feedback/categories.json')
     self.login()
示例#5
0
 def setUp(self):
     super(CreateReportsAPITest, self).setUp()
     self.add_url = smart_urljoin(self.live_server_url, '/report/add/')
     self.data = {
         'geom': '{"type": "Point", "coordinates": [0, 0]}',
         'name': 'You Yeah',
         'email': '*****@*****.**'
     }
     self.login()
示例#6
0
 def setUp(self):
     super(CreateReportsAPITest, self).setUp()
     self.add_url = smart_urljoin(self.live_server_url, '/report/add/')
     self.data = {
         'geom': '{"type": "Point", "coordinates": [0, 0]}',
         'name': 'You Yeah',
         'email': '*****@*****.**'
     }
     self.login()
示例#7
0
 def prepare_elevation_chart(self, rooturl):
     """Converts SVG elevation URI to PNG on disk.
     """
     from .views import HttpSVGResponse
     path = self.get_elevation_chart_path()
     # Do nothing if image is up-to-date
     if is_file_newer(path, self.date_update):
         return False
     # Download converted chart as png using convertit
     source = smart_urljoin(rooturl, self.get_elevation_chart_url())
     convertit_download(source,
                        path,
                        from_type=HttpSVGResponse.content_type,
                        to_type='image/png')
     return True
示例#8
0
文件: models.py 项目: Pitchs/Geotrek
 def prepare_elevation_chart(self, rooturl):
     """Converts SVG elevation URI to PNG on disk.
     """
     from .views import HttpSVGResponse
     path = self.get_elevation_chart_path()
     # Do nothing if image is up-to-date
     if is_file_newer(path, self.date_update):
         return False
     # Download converted chart as png using convertit
     source = smart_urljoin(rooturl, self.get_elevation_chart_url())
     convertit_download(source,
                        path,
                        from_type=HttpSVGResponse.content_type,
                        to_type='image/png')
     return True