Пример #1
0
    def test_Lead_builds_correct_dict(self):
        name = 'Vasya'
        status_id = 123

        amolead = Lead(
            name=name,
            status_id=status_id,
        )

        d = amolead.todict()
        self.assertEqual(
            d,
            {
                "request": {
                    "leads": {
                        "add": [{
                            "name": name,
                            "status_id": status_id,
                            # "status_id":"9211617", # главная воронка
                            # "date_create":1298904164,
                            # "last_modified":1298904164,
                            # "price":300000,
                            # "responsible_user_id":215302,
                            # "tags": "Заявка,beta",
                            # "custom_fields":[{
                            #     "id":461512,
                            #     "values":[{
                            #         "value": 9776621,
                            #         "enum": "HOME"
                            #     }]
                            # }]
                        }]
                    }
                }
            })
Пример #2
0
 def test_Lead_todict_returns_dict(self):
     amolead = Lead(
         name=self.name,
         status_id=123,
     )
     d = amolead.todict()
     self.assertIsNotNone(d)
     self.assertIsInstance(d, dict)