def METHOD_NAME():
    """
    Test reading proper postgres opts in _get_cursor
    """
    pg_connect_mock = MagicMock(return_value=MagicMock())
    test_opts = {
        "postgres": {
            "host": "test_host",
            "user": "test_user",
            "pass": "test_pass",
            "db": "test_db",
            "port": 1234,
        }
    }
    with patch.object(suma_minion, "__opts__", test_opts), patch(
        "suma_minion.psycopg2.connect", pg_connect_mock
    ), patch.dict(suma_minion.__context__, {}):
        suma_minion._get_cursor(cursor_callback)
        assert pg_connect_mock.call_args_list[0][1] == {
            "host": "test_host",
            "user": "test_user",
            "password": "test_pass",
            "dbname": "test_db",
            "port": 1234,
        }
    pg_connect_mock.reset_mock()
    with patch.object(suma_minion, "__opts__", {"__master_opts__": test_opts}), patch(
        "suma_minion.psycopg2.connect", pg_connect_mock
    ), patch.dict(suma_minion.__context__, {}):
        suma_minion._get_cursor(cursor_callback)
        assert pg_connect_mock.call_args_list[0][1] == {
            "host": "test_host",
            "user": "test_user",
            "password": "test_pass",
            "dbname": "test_db",
            "port": 1234,
        }