def test_can_filter_the_journals_by_collections(self): # Setup col_1 = CollectionFactory(code='col1') col_2 = CollectionFactory(code='col2') JournalFactory.create_with_issue(collection=col_1) journal_2 = JournalFactory.create_with_issue(collection=col_2) url = reverse('public:journal:journal_list') # Run response = self.client.get(url, data={'collections': [ 'col2', ]}) # Check assert list(response.context['journals']) == [ journal_2, ]