Writing a test case for file uploads in Play 2.1 and Scala
问题 I found the following question/answer: Test MultipartFormData in Play 2.0 FakeRequest But it seems things have changed in Play 2.1. I've tried adapting the example like so: "Application" should { "Upload Photo" in { running(FakeApplication()) { val data = new MultipartFormData(Map(), List( FilePart("qqfile", "message", Some("Content-Type: multipart/form-data"), TemporaryFile(getClass().getResource("/test/photos/DSC03024.JPG").getFile())) ), List()) val Some(result) = routeAndCall(FakeRequest