def test_payload_not_none_raw_and_not(client, site):
    n = Network(client=client, site_id=site['id'], cidr='8.8.8.0/24')
    assert n.payload
    assert n.ensure()

    n2 = Network(
        raw=get_result(
            client.sites(site['id']).networks('8.8.8.0/24').get()
        )
    )

    assert n2.payload

    # Test some magic methods on raw-init'd instance
    assert len(n2)
    assert n == n2
    assert n2.keys()
    assert n2.items()
Make sure payload gets set fine for both EZ and raw approaches
dataset/ETHPy150Open dropbox/pynsot/tests/test_models.py/test_payload_not_none_raw_and_not