Skip to content

Instantly share code, notes, and snippets.

@AndySun25
Created July 26, 2017 12:21
Show Gist options
  • Save AndySun25/cc3a73dd2a02992b001b51eae52fd461 to your computer and use it in GitHub Desktop.
Save AndySun25/cc3a73dd2a02992b001b51eae52fd461 to your computer and use it in GitHub Desktop.
simplified test
def test_filter_child_events_by_event_type(self):
InsertionFactory(account=children[0].transactional_account, created_by=parent)
transaction_content_type = ContentType.objects.get_for_model(Transaction)
self._test(children[0], status.HTTP_200_OK, set(children[0].events.all()[:10]))
self._test(children[0], status.HTTP_200_OK, set(children[0].events.filter(content_type=transaction_content_type)[:10]),
{'event_type': 'transaction'})
self._test(children[0], status.HTTP_200_OK, [], {'event_type': 'derp'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment