def test_get_context_data(self): user = UserF.create(**{'is_superuser': True}) ProjectF.create_batch(5, add_admins=[user]) ProjectF.create_batch(5) view = ProjectsList() context = view.get_context_data() self.assertEqual(len(context.get('projects')), 10)