'Tests for generating the complete multipartite graph.'

def test_complete_multipartite_graph(self):

    G = nx.complete_multipartite_graph(2, 3, 4)
    blocks = [(0, 1), (2, 3, 4), (5, 6, 7, 8)]
    for block in blocks:
        for (u, v) in itertools.combinations_with_replacement(block, 2):
            assert_true((v not in G[u]))
            assert_equal(G.node[u], G.node[v])
    for (block1, block2) in itertools.combinations(blocks, 2):
        for (u, v) in itertools.product(block1, block2):
            assert_true((v in G[u]))
            assert_not_equal(G.node[u], G.node[v])
