Ejemplo n.º 1
0
    def _verify_viz_object(self, obj, show=False):
        assert_has_keys(obj, *(SHOW_KEYS if show else INDEX_KEYS))

        if show:
            assert "revisions" in obj
            revisions = obj["revisions"]
            assert len(revisions) >= 1

            assert "latest_revision" in obj
            latest_revision = obj["latest_revision"]
            assert_has_keys(latest_revision, *REVISION_KEYS)
            assert latest_revision["model_class"] == "VisualizationRevision"

            assert latest_revision["id"] in revisions
    def _verify_viz_object(self, obj, show=False):
        assert_has_keys(obj, *(SHOW_KEYS if show else INDEX_KEYS))

        if show:
            assert "revisions" in obj
            revisions = obj["revisions"]
            assert len(revisions) >= 1

            assert "latest_revision" in obj
            latest_revision = obj["latest_revision"]
            assert_has_keys(latest_revision, *REVISION_KEYS)
            assert latest_revision["model_class"] == "VisualizationRevision"

            assert latest_revision["id"] in revisions
Ejemplo n.º 3
0
 def test_admin_user_configuration(self):
     config = self._get_configuration(admin=True)
     assert_has_keys(config, *TEST_KEYS_FOR_ALL_USERS)
     assert_has_keys(config, *TEST_KEYS_FOR_ADMIN_ONLY)
Ejemplo n.º 4
0
 def test_normal_user_configuration(self):
     config = self._get_configuration()
     assert_has_keys(config, *TEST_KEYS_FOR_ALL_USERS)
     assert_not_has_keys(config, *TEST_KEYS_FOR_ADMIN_ONLY)
Ejemplo n.º 5
0
 def check_role_dict(role_dict, assert_id=None):
     assert_has_keys(role_dict, "id", "name", "model_class", "url")
     assert role_dict["model_class"] == "Role"
     if assert_id is not None:
         assert role_dict["id"] == assert_id
Ejemplo n.º 6
0
 def check_role_dict(role_dict, assert_id=None):
     assert_has_keys(role_dict, "id", "name", "model_class", "url")
     assert role_dict["model_class"] == "Role"
     if assert_id is not None:
         assert role_dict["id"] == assert_id