Esempio n. 1
0
 def test_sysadmin_is_official(self):
     user = factories.User(sysadmin=True)
     name, obj, drupal_id, type_, this_is_me = user_properties(user['name'])
     assert_equal(type_, 'official')
Esempio n. 2
0
 def test_publisher_is_official(self):
     user = factories.User()
     org_users = [{'name': user['name'], 'capacity': 'editor'}]
     factories.Organization(users=org_users, category='ministerial-department')
     name, obj, drupal_id, type_, this_is_me = user_properties(user['name'])
     assert_equal(type_, 'official')
Esempio n. 3
0
 def test_blank_user_has_no_type(self):
     name, obj, drupal_id, type_, this_is_me = user_properties('')
     assert_equal(type_, None)
Esempio n. 4
0
 def test_random_user_has_no_type(self):
     user = factories.User()
     name, obj, drupal_id, type_, this_is_me = user_properties(user['name'])
     assert_equal(type_, None)
Esempio n. 5
0
 def test_this_is_not_me(self):
     user = factories.User()
     c.user = '******'
     name, obj, drupal_id, type_, this_is_me = user_properties(user['name'])
     assert_equal(this_is_me, False)
Esempio n. 6
0
 def test_this_is_me(self):
     user = factories.User()
     c.user = user['name']
     name, obj, drupal_id, type_, this_is_me = user_properties(user['name'])
     assert_equal(this_is_me, True)
Esempio n. 7
0
 def test_this_is_not_me(self):
     user = factories.User()
     c.user = '******'
     name, obj, drupal_id, type_, this_is_me = user_properties(user['name'])
     assert_equal(this_is_me, False)
Esempio n. 8
0
 def test_obj(self):
     user = factories.User()
     name, obj, drupal_id, type_, this_is_me = user_properties(user['name'])
     assert isinstance(obj, model.User)
     assert_equal(obj.name, user['name'])
Esempio n. 9
0
 def test_obj(self):
     user = factories.User()
     name, obj, drupal_id, type_, this_is_me = user_properties(user['name'])
     assert isinstance(obj, model.User)
     assert_equal(obj.name, user['name'])
Esempio n. 10
0
 def test_name(self):
     user = factories.User()
     name, obj, drupal_id, type_, this_is_me = user_properties(user['name'])
     assert_equal(name, user['name'])
Esempio n. 11
0
 def test_sysadmin_is_official(self):
     user = factories.User(sysadmin=True)
     name, obj, drupal_id, type_, this_is_me = user_properties(user['name'])
     assert_equal(type_, 'official')
Esempio n. 12
0
 def test_random_user_has_no_type(self):
     user = factories.User()
     name, obj, drupal_id, type_, this_is_me = user_properties(user['name'])
     assert_equal(type_, None)
Esempio n. 13
0
 def test_blank_user_has_no_type(self):
     name, obj, drupal_id, type_, this_is_me = user_properties('')
     assert_equal(type_, None)