I was enforcing a sort order one one way to retrieve lanes but not the
other, which ment my tests depended on the database default return
order.
This then impacted another test of 'expected' results which needed to
be updated.
user = HTSUser.objects.get(username=username)
query.update({'library__affiliations__users__id': user.id})
- lanes = Lane.objects.filter(**query).order_by('-flowcell__run_date')
+ lanes = Lane.objects.filter(**query)
result = []
for l in lanes:
class Lane(models.Model):
+ class Meta:
+ ordering = ['-flowcell__run_date', '-library__id']
+
flowcell = models.ForeignKey(FlowCell)
lane_number = models.IntegerField()
library = models.ForeignKey(Library)
library id field matches the library id looked up.
"""
- expected_ids = ['1215{}'.format(i) for i in range(1, 9)]
+ expected_ids = ['1215{}'.format(i) for i in range(8, 0, -1)]
self.assertTrue(self.client.login(username=self.admin.username, password=self.password))
response = self.client.get(
'/admin/experiments/flowcell/{}/change/'.format(self.fc12150.id),