def test_project_csv(self):
        self.login_user(self.superuser)
        self.make_entries()
        response = self._get(
            url_name='view_project_timesheet_csv', url_args=(self.p1.pk,))
        self.assertEqual(response.status_code, 200)
        data = dict(response.items())
        self.assertEqual(data['Content-Type'], 'text/csv')
        disposition = data['Content-Disposition']
        self.assertTrue(disposition.startswith('attachment; filename='))
        contents = response.content.decode('utf-8').splitlines()
        headers = contents[0].split(',')
        # Assure user's comments are not included.
        self.assertTrue('comments' not in headers)
dataset/ETHPy150Open caktus/django-timepiece/timepiece/crm/tests/test_project_timesheet.py/TestProjectTimesheet.test_project_csv/original