[Greater-commits] r324 - trunk/GREAT-ER-DB/impl/postgresql/test
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Jun 30 12:41:12 CEST 2011
Author: bricks
Date: 2011-06-30 12:41:12 +0200 (Thu, 30 Jun 2011)
New Revision: 324
Modified:
trunk/GREAT-ER-DB/impl/postgresql/test/test_pg_l_user.py
Log:
not necessary to save return value of da_insert_user into res
res will be None and the function will throw an error if it fails
Modified: trunk/GREAT-ER-DB/impl/postgresql/test/test_pg_l_user.py
===================================================================
--- trunk/GREAT-ER-DB/impl/postgresql/test/test_pg_l_user.py 2011-06-30 10:39:26 UTC (rev 323)
+++ trunk/GREAT-ER-DB/impl/postgresql/test/test_pg_l_user.py 2011-06-30 10:41:12 UTC (rev 324)
@@ -58,8 +58,7 @@
'mod_date':'29-11-2003',
'status':'VALID',
'remark':'Standard User!'})
- res = da_insert_user(user_record, "hallo")
- self.assertEquals(res, None)
+ da_insert_user(user_record, "hallo")
da_db_commit()
res = da_get_user('john_doe')
@@ -70,6 +69,37 @@
res = da_delete_user('john_doe')
da_db_commit()
+ user_record = DA_S_user({'user_id':'john doe',
+ 'group_id':101,
+ 'cre_date':'30-11-2003',
+ 'mod_date':'29-11-2003',
+ 'status':'VALID',
+ 'remark':'Standard User!'})
+ try:
+ da_insert_user(user_record, "hallo")
+ self.fail("It should not be possible to add a user with spaces in"\
+ " username")
+ except:
+ pass
+
+ user_record = DA_S_user({'user_id':'JOHN_DOE',
+ 'group_id':101,
+ 'cre_date':'30-11-2003',
+ 'mod_date':'29-11-2003',
+ 'status':'VALID',
+ 'remark':'Standard User!'})
+
+ da_insert_user(user_record, "hallo")
+ da_db_commit()
+
+ res = da_get_user('john_doe')
+ self.assertEquals(len(res), 1);
+ # we always get the user_id in uppercase
+ self.assertEquals(res[0].user_id, 'JOHN_DOE');
+
+ res = da_delete_user('john_doe')
+ da_db_commit()
+
def test_1_get_user(self):
today = date.today().strftime("%Y-%m-%d")
@@ -90,7 +120,7 @@
'mod_date':'29-11-2003',
'status':'VALID',
'remark':'Standard User!'})
- res = da_insert_user(user_record, "hallo")
+ da_insert_user(user_record, "hallo")
da_db_commit()
res = da_get_user('john_doe')
@@ -140,7 +170,7 @@
'mod_date':'29-11-2003',
'status':'VALID',
'remark':'Standard User!'})
- res = da_insert_user(user_record, "hallo")
+ da_insert_user(user_record, "hallo")
da_db_commit()
# update user
@@ -169,7 +199,7 @@
'mod_date':'29-11-2003',
'status':'VALID',
'remark':'Standard User!'})
- res = da_insert_user(user_record, "hallo")
+ da_insert_user(user_record, "hallo")
da_db_commit()
res = da_get_user('john_doe')
self.assertEquals(len(res), 1)
@@ -186,7 +216,7 @@
'mod_date':'29-11-2003',
'status':'VALID',
'remark':'Standard User!'})
- res = da_insert_user(user_record, "hallo")
+ da_insert_user(user_record, "hallo")
da_db_commit()
res = da_get_user('john_doe')
self.assertEquals(len(res), 1)
@@ -203,7 +233,7 @@
'mod_date':'29-11-2003',
'status':'VALID',
'remark':'Standard User!'})
- res = da_insert_user(user_record, "hallo")
+ da_insert_user(user_record, "hallo")
da_db_commit()
res = da_get_user('john_doe')
self.assertEquals(len(res), 1)
More information about the Greater-commits
mailing list