def test_objectidconverter_to_python_badrequest(self): ("Test that `ObjectIDConverter.to_python()` raises " "`BadRequest`.") converter = ObjectIDConverter('/') with self.assertRaises(BadRequest): # InvalidId converter.to_python('00000000') with self.assertRaises(BadRequest): # TypeError converter.to_python(1)
def test_objectidconverter_to_python_badrequest(self): ("Test that `ObjectIDConverter.to_python()` raises " "`BadRequest`.") converter = ObjectIDConverter('/') with self.assertRaises(BadRequest): # InvalidId converter.to_python('00000000') with self.assertRaises(BadRequest): # TypeError converter.to_python(1)
def test_objectidconverter_to_python(self): """Test the `ObjectIDConverter.to_python()` method.""" converter = ObjectIDConverter('/') self.assertEqual(converter.to_python(AN_OBJECT_ID_STR), AN_OBJECT_ID)
def test_objectidconverter_to_python(self): """Test the `ObjectIDConverter.to_python()` method.""" converter = ObjectIDConverter('/') self.assertEqual(converter.to_python(AN_OBJECT_ID_STR), AN_OBJECT_ID)