diff rhodecode/tests/test_models.py @ 2513:388843a3a3c0 beta

Updated create_or_update method to not change API key when password is not updated
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 26 Jun 2012 21:57:31 +0200
parents 1f9c467e01eb
children 623e1d68a2e0
line wrap: on
line diff
--- a/rhodecode/tests/test_models.py	Tue Jun 26 04:11:10 2012 +0200
+++ b/rhodecode/tests/test_models.py	Tue Jun 26 21:57:31 2012 +0200
@@ -185,7 +185,7 @@
         usr = UserModel().create_or_update(username=u'test_user',
                                            password=u'qweqwe',
                                      email=u'u232@rhodecode.org',
-                                     name=u'u1', lastname=u'u1')
+                                     firstname=u'u1', lastname=u'u1')
         Session.commit()
         self.assertEqual(User.get_by_username(u'test_user'), usr)
 
@@ -207,7 +207,7 @@
         usr = UserModel().create_or_update(username=u'test_user',
                                            password=u'qweqwe',
                                      email=u'main_email@rhodecode.org',
-                                     name=u'u1', lastname=u'u1')
+                                     firstname=u'u1', lastname=u'u1')
         Session.commit()
 
         def do():
@@ -225,7 +225,7 @@
         usr = UserModel().create_or_update(username=u'test_user',
                                            password=u'qweqwe',
                                      email=u'main_email@rhodecode.org',
-                                     name=u'u1', lastname=u'u1')
+                                     firstname=u'u1', lastname=u'u1')
         Session.commit()
 
         m = UserEmailMap()
@@ -255,7 +255,7 @@
         self.u1 = UserModel().create_or_update(username=u'u1',
                                         password=u'qweqwe',
                                         email=u'u1@rhodecode.org',
-                                        name=u'u1', lastname=u'u1')
+                                        firstname=u'u1', lastname=u'u1')
         Session.commit()
         self.u1 = self.u1.user_id
 
@@ -433,7 +433,7 @@
         self.u1 = UserModel().create_or_update(username=u'u1',
                                         password=u'qweqwe',
                                         email=u'u1@rhodecode.org',
-                                        name=u'u1', lastname=u'u1')
+                                        firstname=u'u1', lastname=u'u1')
 
     def tearDown(self):
         perm = Permission.query().all()
@@ -474,16 +474,16 @@
     def setUp(self):
         self.u1 = UserModel().create_or_update(
             username=u'u1', password=u'qweqwe',
-            email=u'u1@rhodecode.org', name=u'u1', lastname=u'u1'
+            email=u'u1@rhodecode.org', firstname=u'u1', lastname=u'u1'
         )
         self.u2 = UserModel().create_or_update(
             username=u'u2', password=u'qweqwe',
-            email=u'u2@rhodecode.org', name=u'u2', lastname=u'u2'
+            email=u'u2@rhodecode.org', firstname=u'u2', lastname=u'u2'
         )
         self.anon = User.get_by_username('default')
         self.a1 = UserModel().create_or_update(
             username=u'a1', password=u'qweqwe',
-            email=u'a1@rhodecode.org', name=u'a1', lastname=u'a1', admin=True
+            email=u'a1@rhodecode.org', firstname=u'a1', lastname=u'a1', admin=True
         )
         Session.commit()