Beispiel #1
0
 def test_user_id_or_name_exists(self):
     user = factories.User(name='username')
     ctx = self._make_context()
     v = validators.user_id_or_name_exists(user['id'], ctx)
     assert v == user['id']
     v = validators.user_id_or_name_exists(user['name'], ctx)
     assert v == user['name']
Beispiel #2
0
 def test_user_id_or_name_exists(self):
     user = factories.User(name='username')
     ctx = self._make_context()
     v = validators.user_id_or_name_exists(user['id'], ctx)
     assert v == user['id']
     v = validators.user_id_or_name_exists(user['name'], ctx)
     assert v == user['name']
Beispiel #3
0
 def test_group_id_or_name_exists_empty(self):
     ctx = self._make_context()
     v = validators.user_id_or_name_exists('', ctx)
Beispiel #4
0
 def test_group_id_or_name_exists_empty(self):
     ctx = self._make_context()
     v = validators.user_id_or_name_exists('', ctx)
Beispiel #5
0
def test_group_id_or_name_exists_empty():
    with pytest.raises(df.Invalid):
        validators.user_id_or_name_exists("", _make_context())
Beispiel #6
0
def test_user_id_or_name_exists():
    user = factories.User(name="username")
    v = validators.user_id_or_name_exists(user["id"], _make_context())
    assert v == user["id"]
    v = validators.user_id_or_name_exists(user["name"], _make_context())
    assert v == user["name"]