Ejemplo n.º 1
0
 def test_returns_saved_record(self, Repo):
     record = mock.Mock(name="record")
     query = Query(TunaCasserole).where(my_attr=11)
     query.build = mock.Mock(name="build", return_value=record)
     self.assertEqual(query.create(name="foo"), record)
Ejemplo n.º 2
0
 def test_create_saves_record(self, Repo):
     record = mock.Mock(name="record")
     query = Query(TunaCasserole).where(my_attr=11)
     query.build = mock.Mock(name="build", return_value=record)
     query.create(name="foo")
     record.save.assert_called_with()
Ejemplo n.º 3
0
 def test_creates_invokes_build(self, Repo):
     query = Query(TunaCasserole).where(my_attr=11)
     query.build = mock.Mock(name="build")
     query.create(name="foo")
     query.build.assert_called_with(name="foo")
Ejemplo n.º 4
0
 def test_returns_saved_record(self, Repo):
     record = mock.Mock(name="record")
     query = Query(TunaCasserole).where(my_attr=11)
     query.build = mock.Mock(name="build", return_value=record)
     self.assertEqual(query.create(name="foo"), record)
Ejemplo n.º 5
0
 def test_create_saves_record(self, Repo):
     record = mock.Mock(name="record")
     query = Query(TunaCasserole).where(my_attr=11)
     query.build = mock.Mock(name="build", return_value=record)
     query.create(name="foo")
     record.save.assert_called_with()
Ejemplo n.º 6
0
 def test_creates_invokes_build(self, Repo):
     query = Query(TunaCasserole).where(my_attr=11)
     query.build = mock.Mock(name="build")
     query.create(name="foo")
     query.build.assert_called_with(name="foo")