def test_unbound_opt_only_adds_to_strat(self): opts = [ strategy_options._UnboundLoad().some_col_opt_strategy( "name", {"bat": "hoho"}), strategy_options._UnboundLoad().some_col_opt_only( "name", {"foo": "bar"}), ] self._assert_attrs(opts, {"foo": "bar", "bat": "hoho"})
def test_unbound_strat_opt_recvs_from_optonly(self): opts = [ strategy_options._UnboundLoad().some_col_opt_only( "name", {"foo": "bar"}), strategy_options._UnboundLoad().some_col_opt_strategy( "name", {"bat": "hoho"}) ] self._assert_attrs(opts, {"foo": "bar", "bat": "hoho"})
def test_unbound_strat_opt_recvs_from_optonly(self): opts = [ strategy_options._UnboundLoad().some_col_opt_only( "name", {"foo": "bar"} ), strategy_options._UnboundLoad().some_col_opt_strategy( "name", {"bat": "hoho"} ) ] self._assert_attrs(opts, {"foo": "bar", "bat": "hoho"})
def test_unbound_opt_only_adds_to_strat(self): opts = [ strategy_options._UnboundLoad().some_col_opt_strategy( "name", {"bat": "hoho"} ), strategy_options._UnboundLoad().some_col_opt_only( "name", {"foo": "bar"} ), ] self._assert_attrs(opts, {"foo": "bar", "bat": "hoho"})
def test_single_opt_only(self): opt = strategy_options._UnboundLoad().some_col_opt_only( "name", {"foo": "bar"}) self._assert_attrs([opt], {"foo": "bar"})
def test_single_opt_only(self): opt = strategy_options._UnboundLoad().some_col_opt_only( "name", {"foo": "bar"} ) self._assert_attrs([opt], {"foo": "bar"})
def raiseload_col(*attrs): return _UnboundLoad().raiseload_col(*attrs)
def selectinquery(relationship, alter_query, cache_key=None): return _UnboundLoad.selectinquery(_UnboundLoad(), relationship, alter_query, cache_key)
def nplus1loader(*attrs, nested=True): return _UnboundLoad().nplus1loader(*attrs, nested=nested)
def default_columns(model): return _UnboundLoad().default_columns(model)