File: //home/arjun/projects/buyercall_forms/buyercall/buyercall/tests/agent/test_forms.py
from buyercall.blueprints.agents.models import Agent
from buyercall.tests.lib.util import ViewTestMixin
from buyercall.blueprints.agents.forms import AgentForm, GroupForm
class TestAgentForm(ViewTestMixin):
def test_agent_form(self):
agent = Agent.query.filter().first()
agent_form = AgentForm(obj=agent)
assert agent_form is not None
def test_group_form(self, agents):
group_form = GroupForm()
g = Agent.query.filter(
Agent.is_group == True
).first()
group_form.name.data = g.firstname
group_form.description.data = g.description
group_form.group_agents.data = 'test'
assert group_form is not None