def handle(self, *args, **options): for project_slug in args: try: project = Project.objects.get(slug=project_slug) except Project.DoesNotExist: raise CommandError('Project "%s" does not exist' % project_slug) data = project_to_dict(project) print(self.renderer.render(data, renderer_context=self.renderer_context).decode('utf-8'))
def handle(self, *args, **options): for project_slug in args: try: project = Project.objects.get(slug=project_slug) except Project.DoesNotExist: raise CommandError('Project "%s" does not exist' % project_slug) data = project_to_dict(project) with open('%s.json'%(project_slug), 'w') as outfile: self.renderer.render_to_file(data, outfile, renderer_context=self.renderer_context)
def handle(self, *args, **options): for project_slug in args: try: project = Project.objects.get(slug=project_slug) except Project.DoesNotExist: raise CommandError('Project "%s" does not exist' % project_slug) data = project_to_dict(project) with open('%s.json' % (project_slug), 'w') as outfile: self.renderer.render_to_file( data, outfile, renderer_context=self.renderer_context)
def handle(self, *args, **options): for project_slug in args: try: project = Project.objects.get(slug=project_slug) except Project.DoesNotExist: raise CommandError('Project "%s" does not exist' % project_slug) data = project_to_dict(project) print( self.renderer.render( data, renderer_context=self.renderer_context).decode('utf-8'))
def test_export_user_story_finish_date(client): user_story = f.UserStoryFactory.create(finish_date="2014-10-22") finish_date = project_to_dict( user_story.project)["user_stories"][0]["finish_date"] assert finish_date == "2014-10-22T00:00:00+0000"
def test_export_issue_finish_date(client): issue = f.IssueFactory.create(finished_date="2014-10-22") finish_date = project_to_dict(issue.project)["issues"][0]["finished_date"] assert finish_date == "2014-10-22T00:00:00+0000"