def test_get_owned_nodes_owners(self): user1 = factory.make_user() user2 = factory.make_user() factory.make_user() factory.make_node(owner=user1) factory.make_node(owner=user2) factory.make_node(owner=None) self.assertSetEqual({user1, user2}, set(get_owned_nodes_owners()))
def test_get_owned_nodes_owners_no_users(self): self.assertEqual([], list(get_owned_nodes_owners()))
def test_get_owned_nodes_owners_no_owned_nodes(self): factory.make_user() factory.make_node(owner=None) self.assertEqual([], list(get_owned_nodes_owners()))
def test_get_owned_nodes_owners_no_nodes(self): factory.make_User() self.assertEqual([], list(get_owned_nodes_owners()))