mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 04:32:36 +01:00
plugins/QuoteGrabs: Order the quotes in reverse chronological order.
This commit is contained in:
parent
cede4a4a97
commit
a035492295
@ -128,7 +128,7 @@ class SqliteQuoteGrabsDB(object):
|
|||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
cursor.execute("""SELECT id, quote FROM quotegrabs
|
cursor.execute("""SELECT id, quote FROM quotegrabs
|
||||||
WHERE nickeq(nick, %s)
|
WHERE nickeq(nick, %s)
|
||||||
ORDER BY id ASC""", nick)
|
ORDER BY id DESC""", nick)
|
||||||
return [QuoteGrabsRecord(id, text=quote)
|
return [QuoteGrabsRecord(id, text=quote)
|
||||||
for (id, quote) in cursor.fetchall()]
|
for (id, quote) in cursor.fetchall()]
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ class QuoteGrabsTestCase(ChannelPluginTestCase):
|
|||||||
prefix=testPrefix))
|
prefix=testPrefix))
|
||||||
self.assertNotError('grab foo')
|
self.assertNotError('grab foo')
|
||||||
self.assertResponse('quotegrabs list foo',
|
self.assertResponse('quotegrabs list foo',
|
||||||
'#1: test and #2: %s...' %\
|
'#2: %s... and #1: test' %\
|
||||||
('a'*43)) # 50 - length of "#2: ..."
|
('a'*43)) # 50 - length of "#2: ..."
|
||||||
|
|
||||||
def testDuplicateGrabs(self):
|
def testDuplicateGrabs(self):
|
||||||
@ -109,7 +109,7 @@ class QuoteGrabsTestCase(ChannelPluginTestCase):
|
|||||||
self.assertError('quotegrabs search test') # still none in db
|
self.assertError('quotegrabs search test') # still none in db
|
||||||
self.assertNotError('grab foo')
|
self.assertNotError('grab foo')
|
||||||
self.assertNotError('quotegrabs search test')
|
self.assertNotError('quotegrabs search test')
|
||||||
|
|
||||||
|
|
||||||
class QuoteGrabsNonChannelTestCase(QuoteGrabsTestCase):
|
class QuoteGrabsNonChannelTestCase(QuoteGrabsTestCase):
|
||||||
config = { 'databases.plugins.channelSpecific' : False }
|
config = { 'databases.plugins.channelSpecific' : False }
|
||||||
|
Loading…
Reference in New Issue
Block a user