def test_by_symbol(): one = Short.create(symbol="one", target="1") two = Short.create(symbol="two", target="2") assert Short.by_symbol("null") is None assert Short.by_symbol("one") == one assert Short.by_symbol("two") == two assert Short.by_symbol("three") is None
def test_by_symbol_active(): act = Short.create(symbol="act", target="act", active=True) ina = Short.create(symbol="ina", target="ina", active=False) assert Short.by_symbol_active("lol") is None assert Short.by_symbol_active("act") == act assert Short.by_symbol_active("ina") is None assert Short.by_symbol("ina") == ina