Commit c420153a authored by Dmitry Volodin's avatar Dmitry Volodin
Browse files

DataStream id_clean tests

parent 06c63a19
......@@ -235,3 +235,18 @@ def test_datastream_delete_object():
assert doc
assert "data" in doc
assert "$deleted" in doc["data"]
def test_datastream_clean_id():
assert ExampleDataStream.clean_id(1) == 1
assert ExampleDataStream.clean_id("1") == "1"
def test_datastream_clean_id_int():
class DS(DataStream):
clean_id = DataStream.clean_id_int
assert DS.clean_id(1) == 1
assert DS.clean_id("1") == 1
with pytest.raises(ValueError):
DS.clean_id("z")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment