(self)
| 514 | assert test_file.the_file.read() == b"Hello, World!" |
| 515 | |
| 516 | def test_copyable(self): |
| 517 | class PutFile(Document): |
| 518 | the_file = FileField() |
| 519 | |
| 520 | PutFile.drop_collection() |
| 521 | |
| 522 | text = b"Hello, World!" |
| 523 | content_type = "text/plain" |
| 524 | |
| 525 | putfile = PutFile() |
| 526 | putfile.the_file.put(text, content_type=content_type) |
| 527 | putfile.save() |
| 528 | |
| 529 | class TestFile(Document): |
| 530 | name = StringField() |
| 531 | |
| 532 | assert putfile == copy.copy(putfile) |
| 533 | assert putfile == copy.deepcopy(putfile) |
| 534 | |
| 535 | @require_pil |
| 536 | def test_get_image_by_grid_id(self): |
nothing calls this directly
no test coverage detected