当前位置: 首页>>代码示例>>Python>>正文


Python mommy.save_one函数代码示例

本文整理汇总了Python中mommygae.mommy.save_one函数的典型用法代码示例。如果您正苦于以下问题:Python save_one函数的具体用法?Python save_one怎么用?Python save_one使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了save_one函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_success_with_nodes

    def test_success_with_nodes(self):
        origin = mommy.save_one(Node)
        destination = mommy.save_one(Node)
        CreateUniqueArcExample(origin, destination)()
        has_arc_cmd = HasArcExample(origin, destination)

        self.assertIsNotNone(has_arc_cmd())
开发者ID:GuidoBR,项目名称:gaegraph,代码行数:7,代码来源:business_tests.py

示例2: test_create_single_arc_for_second_time_error

    def test_create_single_arc_for_second_time_error(self):
        destination = mommy.save_one(Node)
        origin = mommy.save_one(Node)
        cmd = CreateSingleArcExample(origin, destination)
        self.assert_arc_creation(cmd, origin, destination)

        cmd = CreateSingleArcExample(origin, destination)
        self.assertRaises(CommandExecutionException, cmd)
开发者ID:GuidoBR,项目名称:gaegraph,代码行数:8,代码来源:business_tests.py

示例3: test_success

 def test_success(self):
     mommy.save_one(Jogo)
     mommy.save_one(Jogo)
     json_response = rest.index()
     context = json_response.context
     self.assertEqual(2, len(context))
     jogo_dct = context[0]
     self.assertSetEqual(set(['id', 'creation', 'foto', 'tmp', 'map', 'qtd', 'tit', 'grp']), set(jogo_dct.iterkeys()))
     self.assert_can_serialize_as_json(json_response)
开发者ID:IuryAlves,项目名称:Novos-Bandeirantes,代码行数:9,代码来源:jogo_rest_tests.py

示例4: test_success

 def test_success(self):
     mommy.save_one(User)
     mommy.save_one(User)
     json_response = rest.index()
     context = json_response.context
     self.assertEqual(2, len(context))
     user_dct = context[0]
     self.assertSetEqual(set(['id', 'creation', 'password']), set(user_dct.iterkeys()))
     self.assert_can_serialize_as_json(json_response)
开发者ID:cicerocasj,项目名称:Catequizando,代码行数:9,代码来源:user_rest_tests.py

示例5: test_only_destination_has_arc

 def test_only_destination_has_arc(self):
     origin = mommy.save_one(Node)
     destination = mommy.save_one(Node)
     another_origin = mommy.save_one(Node)
     arc = CreateArcExample(origin, destination)()
     self.assertEqual(arc.key, HasArcExample(origin=origin)())
     self.assertEqual(arc.key, HasArcExample(destination=destination)())
     self.assertEqual(arc.key, HasArcExample(origin, destination)())
     self.assertIsNone(HasArcExample(another_origin, destination)())
开发者ID:GuidoBR,项目名称:gaegraph,代码行数:9,代码来源:business_tests.py

示例6: test_success

 def test_success(self):
     mommy.save_one(Venda)
     mommy.save_one(Venda)
     json_response = rest.index()
     context = json_response.context
     self.assertEqual(2, len(context))
     venda_dct = context[0]
     self.assertSetEqual(set(['id', 'creation', 'preco','status']), set(venda_dct.iterkeys()))
     self.assert_can_serialize_as_json(json_response)
开发者ID:renzon,项目名称:appengineepython,代码行数:9,代码来源:venda_rest_tests.py

示例7: test_success

 def test_success(self):
     mommy.save_one(Profile)
     mommy.save_one(Profile)
     json_response = rest.index()
     context = json_response.context
     self.assertEqual(2, len(context))
     profile_dct = context[0]
     self.assertSetEqual(set(['id', 'creation', 'user', 'tipo']), set(profile_dct.iterkeys()))
     self.assert_can_serialize_as_json(json_response)
开发者ID:cicerocasj,项目名称:Catequizando,代码行数:9,代码来源:profile_rest_tests.py

示例8: test_success

 def test_success(self):
     mommy.save_one(Formacao)
     mommy.save_one(Formacao)
     json_response = rest.index()
     context = json_response.context
     self.assertEqual(2, len(context))
     formacao_dct = context[0]
     self.assertSetEqual(set(['id', 'creation', 'titulo', 'data', 'conteudo']), set(formacao_dct.iterkeys()))
     self.assert_can_serialize_as_json(json_response)
开发者ID:cicerocasj,项目名称:Catequizando,代码行数:9,代码来源:formacao_rest_tests.py

示例9: test_success

 def test_success(self):
     mommy.save_one(Evento)
     mommy.save_one(Evento)
     json_response = rest.index()
     context = json_response.context
     self.assertEqual(2, len(context))
     evento_dct = context[0]
     self.assertSetEqual(set(['id', 'creation', 'start', 'end', 'description', 'title']), set(evento_dct.iterkeys()))
     self.assert_can_serialize_as_json(json_response)
开发者ID:cicerocasj,项目名称:Catequizando,代码行数:9,代码来源:evento_rest_tests.py

示例10: test_success

 def test_success(self):
     mommy.save_one(Categoria)
     mommy.save_one(Categoria)
     json_response = rest.index()
     context = json_response.context
     self.assertEqual(2, len(context))
     categoria_dct = context[0]
     self.assertSetEqual(set(['id', 'creation', 'codigo', 'nome']), set(categoria_dct.iterkeys()))
     self.assert_can_serialize_as_json(json_response)
开发者ID:guilhermegdaf,项目名称:scripts-backend,代码行数:9,代码来源:categoria_rest_tests.py

示例11: test_success

 def test_success(self):
     mommy.save_one(Noticia)
     mommy.save_one(Noticia)
     json_response = rest.index()
     context = json_response.context
     self.assertEqual(2, len(context))
     noticia_dct = context[0]
     self.assertSetEqual(set(['id', 'creation', 'content', 'link', 'title']), set(noticia_dct.iterkeys()))
     self.assert_can_serialize_as_json(json_response)
开发者ID:cicerocasj,项目名称:Catequizando,代码行数:9,代码来源:noticia_rest_tests.py

示例12: test_success

 def test_success(self):
     mommy.save_one(Membro)
     mommy.save_one(Membro)
     json_response = rest.index()
     context = json_response.context
     self.assertEqual(2, len(context))
     membro_dct = context[0]
     self.assertSetEqual(set(['id', 'creation', 'cargo', 'nome', 'cpf', 'rg', 'telefone', 'endereco', 'data']), set(membro_dct.iterkeys()))
     self.assert_can_serialize_as_json(json_response)
开发者ID:priscilamelosilva,项目名称:Membros,代码行数:9,代码来源:membro_rest_tests.py

示例13: setup_call_stat

 def setup_call_stat(self, LoginClassMock):
     login_obj = Login(None, None, None, None)
     main_user = mommy.save_one(MainUser, email='[email protected]')
     login_obj.result = main_user
     login_obj.set_up = Mock()
     login_obj.do_business = Mock()
     login_obj.commit = lambda: None
     LoginClassMock.return_value = login_obj
     external_user = mommy.save_one(GoogleUser)
     pending_key = PendingExternalToMainUser(external_user=external_user.key, main_user=main_user.key).put()
     return external_user, main_user, pending_key
开发者ID:GuidoBR,项目名称:gaepermission,代码行数:11,代码来源:base_commands2_tests.py

示例14: test_delete

    def test_delete(self):
        model = mommy.save_one(ModelStub)
        self.assertIsNotNone(model.key.get())
        DeleteCommand(model.key).execute()
        self.assertIsNone(model.key.get())

        models = [mommy.save_one(ModelStub) for i in range(3)]
        model_keys = [m.key for m in models]
        self.assertListEqual(models, ndb.get_multi(model_keys))
        DeleteCommand(*model_keys).execute()
        self.assertListEqual([None, None, None], ndb.get_multi(model_keys))
开发者ID:renzon,项目名称:gaebusiness,代码行数:11,代码来源:business_tests.py

示例15: test_create_arc_with_commands

    def test_create_arc_with_commands(self):
        destination = mommy.save_one(Node)
        origin = mommy.save_one(Node)

        cmd = CreateArcExample(NodeSearch(origin), destination)
        self.assert_arc_creation(cmd, origin, destination)

        cmd = CreateArcExample(origin, NodeSearch(destination))
        self.assert_arc_creation(cmd, origin, destination)

        cmd = CreateArcExample(NodeSearch(origin), NodeSearch(destination))
        self.assert_arc_creation(cmd, origin, destination)
开发者ID:GuidoBR,项目名称:gaegraph,代码行数:12,代码来源:business_tests.py


注:本文中的mommygae.mommy.save_one函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。