diff --git a/tests/test_canvas_object.py b/tests/test_canvas_object.py index 859fb8aa..e083cd3a 100644 --- a/tests/test_canvas_object.py +++ b/tests/test_canvas_object.py @@ -81,3 +81,22 @@ def test_set_attributes_with_content_type(self, m): self.assertEqual(self.canvas_object.content_type, "another_application/json") self.assertTrue(hasattr(self.canvas_object, "filename")) self.assertEqual(self.canvas_object.filename, "example.json") + + def test_set_attributes_with_content_type_reversed(self, m): + # Reversed the order of the attributes to test overwrite behavior + attributes = { + "content_type": "another_application/json", + "content-type": "application/json", + "filename": "example.json", + } + + self.canvas_object.set_attributes(attributes) + + self.assertTrue(hasattr(self.canvas_object, "content-type")) + self.assertEqual( + getattr(self.canvas_object, "content-type"), "application/json" + ) + self.assertTrue(hasattr(self.canvas_object, "content_type")) + self.assertEqual(self.canvas_object.content_type, "another_application/json") + self.assertTrue(hasattr(self.canvas_object, "filename")) + self.assertEqual(self.canvas_object.filename, "example.json")