def METHOD_NAME(cls, pkg_name, user, create_org_and_group=True):
    '''
    :param pkg_name: the name of the new package
    :type pkg_name: str
    :param user: the username of the user creating the package
    :type user: str
    :param create_org_and_group: whether to create the org and group for the package. Might've been created already.
    :type create_org_and_group: bool
    :return: id of newly created package
    :rtype: str
    '''
    if create_org_and_group:
        factories.Organization(name='test_owner_org', org_url='http://example.org/',
                               hdx_org_type=ORGANIZATION_TYPE_LIST[0][1],
                               users=[{'name': 'testsysadmin', 'capacity': 'admin'}]
                               )
        factories.Group(name='test_group1')
    package = {
        "package_creator": "test function",
        "private": False,
        "dataset_date": "[1960-01-01 TO 2012-12-31]",
        "caveats": "These are the caveats",
        "license_other": "TEST OTHER LICENSE",
        "methodology": "This is a test methodology",
        "dataset_source": "Test data",
        "license_id": "hdx-other",
        "name": pkg_name,
        "notes": "This is a test dataset",
        "title": "Test Dataset for QA Completed " + pkg_name,
        "owner_org": "test_owner_org",
        "groups": [{"name": "test_group1"}],
        "maintainer": "testsysadmin",
        "data_update_frequency": "0",
        "resources": [
            {
                'package_id': pkg_name,
                'url': config.get('ckan.site_url', '') + '/storage/f/test_folder/hdx_test.csv',
                'resource_type': 'file.upload',
                'url_type': 'upload',
                'format': 'CSV',
                'name': 'hdx_test.csv'
            }
        ]
    }
    context = {'model': model, 'session': model.Session, 'user': user}
    package_dict = _get_action('package_create')(context, package)
    return package_dict