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()
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()
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()
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