# HG changeset patch # User Julien Cristau # Date 1398171804 -7200 # Node ID 1f6ecd90df4ff7a01d0401362e9d00687611b75b # Parent 00c2356faba714dba6a7a0052c920687cfd531c5 [sobjects/test] check that register_user properly sets user name and email address Related to #3020639 diff -r 00c2356faba7 -r 1f6ecd90df4f sobjects/test/unittest_register_user.py --- a/sobjects/test/unittest_register_user.py Fri Jul 19 17:38:15 2013 +0200 +++ b/sobjects/test/unittest_register_user.py Tue Apr 22 15:03:24 2014 +0200 @@ -25,7 +25,7 @@ class RegisterUserTC(CubicWebTC): def test_register_user_service(self): - acc = self.new_access('admin') + acc = self.admin_access with acc.client_cnx() as cnx: cnx.call_service('register_user', login=u'foo1', password=u'bar1', email=u'foo1@bar1.com', firstname=u'Foo1', @@ -46,6 +46,18 @@ cnx.call_service('register_user', login=u'foo3', password=u'bar3') + def test_register_user_attributes(self): + with self.repo.internal_cnx() as cnx: + cnx.call_service('register_user', login=u'foo3', + password=u'bar3', email=u'foo3@bar3.com', + firstname=u'Foo3', surname=u'Bar3') + cnx.commit() + + with self.admin_access.client_cnx() as cnx: + user = cnx.find('CWUser', login=u'foo3').one() + self.assertEqual(user.firstname, u'Foo3') + self.assertEqual(user.use_email[0].address, u'foo3@bar3.com') + if __name__ == '__main__': from logilab.common.testlib import unittest_main