def setUp(self): super(APITestBase, self).setUp() self.series = Series.objects.all()[0] self.patch = Patch.objects.all()[2] self.user = TestUser(username='******') self.maintainer = TestUser(username='******') self.maintainer.add_to_maintainers(self.project) self.maintainer2 = TestUser(username='******') self.maintainer2.add_to_maintainers(self.project) # a second series so we can test ordering/filtering test_series = TestSeries(3, project=self.project) time.sleep(1) test_series.insert() self.series2 = Series.objects.all().order_by('submitted')[1] # different user so sorting by submitter is a simple list reversal series3_sender = 'Test Author 3 <*****@*****.**>' # no cover letter test_series = TestSeries(3, project=self.project, sender=series3_sender, has_cover_letter=False) time.sleep(1) test_series.insert() self.series3 = Series.objects.all().order_by('submitted')[2] self.n_series = Series.objects.all().count() self.last_inserted_series = self.series3