summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b7e578a)
raw | patch | inline | side by side (parent: b7e578a)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 24 Mar 2003 04:47:44 +0000 (04:47 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 24 Mar 2003 04:47:44 +0000 (04:47 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1621 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/backends/rdbms_common.py | patch | blob | history | |
test/test_mailgw.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index f811fcb47f111c44fc82b3f10e85bbdf4e672ccb..e15788b0074aa295436fdd7322ce34bb8b2af8b8 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- fixed sqlite rollback/caching bug (sf bug 689383)
- fixed rdbms table update detection logic (sf bug 703297)
- fixed detection of bad date specs (sf bug 691439)
+- fixed rdbms email address lookup (case insensitivity)
2003-02-27 0.5.6
index e560629123836efa97b50c28f59a1285c9cc3236..a350425677f7d6218cc6c68eeded25043b4375d5 100644 (file)
-# $Id: rdbms_common.py,v 1.47 2003-03-21 04:02:13 richard Exp $
+# $Id: rdbms_common.py,v 1.48 2003-03-24 04:47:44 richard Exp $
''' Relational database (SQL) backend common code.
Basics:
args.append(requirements[propname].lower())
# generate the where clause
- s = ' and '.join(['_%s=%s'%(col, self.db.arg) for col in where])
+ s = ' and '.join(['lower(_%s)=%s'%(col, self.db.arg) for col in where])
sql = 'select id from _%s where %s'%(self.classname, s)
self.db.sql(sql, tuple(args))
l = [x[0] for x in self.db.sql_fetchall()]
diff --git a/test/test_mailgw.py b/test/test_mailgw.py
index cfcd82f30dc2fe857eb8228cef5750cfb507f307..0b96889a914f7f54bdbd95ee3c3e2c5990ba7b83 100644 (file)
--- a/test/test_mailgw.py
+++ b/test/test_mailgw.py
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: test_mailgw.py,v 1.41 2003-03-13 09:27:24 kedder Exp $
+# $Id: test_mailgw.py,v 1.42 2003-03-24 04:47:44 richard Exp $
import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib
+import rfc822
# Note: Should parse emails according to RFC2822 instead of performing a
# literal string comparision. Parsing the messages allows the tests to work for
#except ImportError :
# import rfc822 as email
-from roundup.mailgw import MailGW, Unauthorized
+from roundup.mailgw import MailGW, Unauthorized, uidFromAddress
from roundup import init, instance
# TODO: make this output only enough equal lines for context, not all of
self.compareStrings(self.db.msg.get(messageid, 'content'), expect)
+ def testUserLookup(self):
+ i = self.db.user.create(username='user1', address='user1@foo.com')
+ self.assertEqual(uidFromAddress(self.db, ('', 'user1@foo.com'), 0), i)
+ self.assertEqual(uidFromAddress(self.db, ('', 'USER1@foo.com'), 0), i)
+ i = self.db.user.create(username='user2', address='USER2@foo.com')
+ self.assertEqual(uidFromAddress(self.db, ('', 'USER2@foo.com'), 0), i)
+ self.assertEqual(uidFromAddress(self.db, ('', 'user2@foo.com'), 0), i)
+
def suite():
l = [unittest.makeSuite(MailgwTestCase),
]