forked from isso-comments/isso
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
isso: migrate: Handle deleted comments in Disqus migration (isso-comm…
…ents#994) * isso: migrate: Handle deleted comments in Disqus migration Fixes isso-comments#979
- Loading branch information
Showing
5 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,4 +113,37 @@ | |
<thread dsq:id="7" /> | ||
</post> | ||
|
||
<!-- deleted post --> | ||
<post dsq:id="9"> | ||
<id/> | ||
<message/> | ||
<createdAt>2013-10-10T19:20:29Z</createdAt> | ||
<isDeleted>true</isDeleted> | ||
<isSpam>false</isSpam> | ||
<author> | ||
<email>[email protected]</email> | ||
<name>peter</name> | ||
<isAnonymous>true</isAnonymous> | ||
</author> | ||
<ipAddress>127.0.0.1</ipAddress> | ||
<thread dsq:id="2" /> | ||
</post> | ||
|
||
<!-- reference to previous deleted post --> | ||
<post dsq:id="11"> | ||
<message><![CDATA[<p>Hello, World.</p>]]></message> | ||
<createdAt>2013-10-11T06:52:33Z</createdAt> | ||
<isDeleted>false</isDeleted> | ||
<isSpam>false</isSpam> | ||
<author> | ||
<email>[email protected]</email> | ||
<name>user</name> | ||
<isAnonymous>false</isAnonymous> | ||
<username>user</username> | ||
</author> | ||
<ipAddress>127.0.0.1</ipAddress> | ||
<thread dsq:id="2" /> | ||
<parent dsq:id="9" /> | ||
</post> | ||
|
||
</disqus> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,7 @@ def test_disqus_empty_id_workaround(self): | |
Disqus(db, xml, empty_id=True).migrate() | ||
|
||
self.assertEqual( | ||
len(db.execute("SELECT id FROM comments").fetchall()), 3) | ||
len(db.execute("SELECT id FROM comments").fetchall()), 5) | ||
|
||
self.assertEqual(db.threads["/"]["title"], "Hello, World!") | ||
self.assertEqual(db.threads["/"]["id"], 1) | ||
|
@@ -67,9 +67,12 @@ def test_disqus_empty_id_workaround(self): | |
self.assertEqual(a["email"], "[email protected]") | ||
self.assertEqual(a["remote_addr"], "127.0.0.0") | ||
|
||
b = db.comments.get(2) | ||
b = db.comments.get(3) | ||
self.assertEqual(b["parent"], a["id"]) | ||
|
||
deleted_comment = db.comments.get(2) | ||
self.assertEqual(deleted_comment["text"], "") | ||
|
||
def test_wordpress(self): | ||
|
||
xml = join(dirname(__file__), "wordpress.xml") | ||
|