def METHOD_NAME(as_string):
    """Check we create a global symbol for the models.
    See also the same test in
      sherpa/astro/ui/tests/test_astro_session.py
      sherpa/astro/ui/tests/test_astro_ui_unit.py
    """
    # The "global" symbol table depends on what has been run before. We
    # could try and make sure that we are "clean", but this makes checking
    # what this test is doing hard to do, so we remove the symbols just
    # in case.
    #
    for name in ["mdl1", "mdl2"]:
        try:
            del sys.modules["__main__"].__dict__[name]
        except KeyError:
            pass
    dataspace1d(1, 10, 1)
    for store in [globals(), locals(), sys.modules["__main__"].__dict__]:
        assert "mdl1" not in store
        assert "mdl2" not in store
    if as_string:
        set_source("const1d.mdl1 + gauss1d.mdl2")
    else:
        set_source(const1d.mdl1 + gauss1d.mdl2)
    for store in [globals(), locals()]:
        assert "mdl1" not in store
        assert "mdl2" not in store
    assert "mdl1" in sys.modules["__main__"].__dict__
    assert "mdl2" in sys.modules["__main__"].__dict__
    assert isinstance(sys.modules["__main__"].__dict__["mdl1"],
                      sherpa.models.basic.Const1D)
    assert isinstance(sys.modules["__main__"].__dict__["mdl2"],
                      sherpa.models.basic.Gauss1D)
    clean()