Skip to content

Commit 852509c

Browse files
committed
updated test for clean_up_draft_files. ready to merge
- Legacy-Id: 7396
1 parent 9f29264 commit 852509c

1 file changed

Lines changed: 5 additions & 19 deletions

File tree

ietf/doc/tests_draft.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -567,12 +567,11 @@ def test_clean_up_draft_files(self):
567567

568568
clean_up_draft_files()
569569

570-
# txt files shouldn't be moved (for some reason)
571-
self.assertTrue(os.path.exists(os.path.join(self.id_dir, txt)))
572-
573-
self.assertTrue(not os.path.exists(os.path.join(self.id_dir, pdf)))
574-
self.assertTrue(os.path.exists(os.path.join(self.archive_dir, "unknown_ids", pdf)))
570+
self.assertTrue(not os.path.exists(os.path.join(self.id_dir, txt)))
571+
self.assertTrue(os.path.exists(os.path.join(self.archive_dir, txt)))
575572

573+
self.assertTrue(not os.path.exists(os.path.join(self.id_dir, pdf)))
574+
self.assertTrue(os.path.exists(os.path.join(self.archive_dir, pdf)))
576575

577576
# expire draft
578577
draft.set_state(State.objects.get(used=True, type="draft", slug="expired"))
@@ -587,26 +586,13 @@ def test_clean_up_draft_files(self):
587586
e.time = draft.expires
588587
e.save()
589588

590-
# expired without tombstone
591589
txt = "%s-%s.txt" % (draft.name, draft.rev)
592590
self.write_draft_file(txt, 5000)
593591

594592
clean_up_draft_files()
595593

596594
self.assertTrue(not os.path.exists(os.path.join(self.id_dir, txt)))
597-
self.assertTrue(os.path.exists(os.path.join(self.archive_dir, "expired_without_tombstone", txt)))
598-
599-
600-
# expired with tombstone
601-
revision_before = draft.rev
602-
603-
txt = "%s-%s.txt" % (draft.name, draft.rev)
604-
self.write_draft_file(txt, 1000) # < 1500 means tombstone
605-
606-
clean_up_draft_files()
607-
608-
self.assertTrue(not os.path.exists(os.path.join(self.id_dir, txt)))
609-
self.assertTrue(os.path.exists(os.path.join(self.archive_dir, "deleted_tombstones", txt)))
595+
self.assertTrue(os.path.exists(os.path.join(self.archive_dir, txt)))
610596

611597

612598
class ExpireLastCallTests(TestCase):

0 commit comments

Comments
 (0)