コード例 #1
0
 def test_primary_key(self):
     """should use configured primary_key in url"""
     TestModel.attributes("id", "foo")
     model = TestModel({"id": 7, "foo": 12345})
     self.config["primary_key"] = "foo"
     adapter = RestfulHttpAdapter(self.config, mode="read")
     url = adapter.url_for("GET", model)
     self.assertEqual(url, "/widgets/12345.xml")