def test_form_accepts_db(self): db = pretend.stub() form = DBForm(db=db) assert form.db is db
def test_form_requires_db(self): with pytest.raises(TypeError): DBForm()