Beispiel #1
0
    def set_id(cls, v, values, **kwargs) -> int:
        """
        If id is supplied (ex. from DB) then use it, otherwise generate new.
        """
        if v:
            return v

        return get_next_id()
def test_get_next_id():
    _id = get_next_id()
    assert _id.bit_length() <= 32