コード例 #1
0
 def testRenderAddUsersWithError(self):
   """Test the user add form is rendered properly with an error."""
   # Disabling the protected access check here intentionally so we can test a
   # private method.
   # pylint: disable=protected-access
   fake_error = 'foo bar happened causing baz'
   add_users_template = user._RenderAddUsersTemplate([], fake_error)
   self.assertTrue('An error occurred while' in add_users_template)
   self.assertTrue(fake_error in add_users_template)
コード例 #2
0
 def testRenderAddUsersWithUsers(self):
   """Test the user add form is rendered properly with users."""
   # Disabling the protected access check here intentionally so we can test a
   # private method.
   # pylint: disable=protected-access
   add_users_template = user._RenderAddUsersTemplate(FAKE_USER_ARRAY)
   self.assertTrue('Add Selected Users' in add_users_template)
   self.assertTrue('xsrf' in add_users_template)
   self.assertTrue('An error occurred while' not in add_users_template)
コード例 #3
0
 def testRenderAddUsersWithError(self):
     """Test the user add form is rendered properly with an error."""
     # Disabling the protected access check here intentionally so we can test a
     # private method.
     # pylint: disable=protected-access
     fake_error = 'foo bar happened causing baz'
     add_users_template = user._RenderAddUsersTemplate([], fake_error)
     self.assertTrue('An error occurred while' in add_users_template)
     self.assertTrue(fake_error in add_users_template)
コード例 #4
0
 def testRenderAddUsersWithUsers(self):
     """Test the user add form is rendered properly with users."""
     # Disabling the protected access check here intentionally so we can test a
     # private method.
     # pylint: disable=protected-access
     add_users_template = user._RenderAddUsersTemplate(FAKE_USER_ARRAY)
     self.assertTrue('Add Selected Users' in add_users_template)
     self.assertTrue('xsrf' in add_users_template)
     self.assertTrue('An error occurred while' not in add_users_template)
コード例 #5
0
 def testRenderAddUsersWithNoUsers(self):
   """Test the user add form is rendered properly without users."""
   # Disabling the protected access check here intentionally so we can test a
   # private method.
   # pylint: disable=protected-access
   add_users_template = user._RenderAddUsersTemplate([])
   no_user_string = 'No users found. Try another query below.'
   self.assertTrue(no_user_string in add_users_template)
   self.assertTrue('xsrf' in add_users_template)
   self.assertTrue('An error occurred while' not in add_users_template)
コード例 #6
0
 def testRenderAddUsersWithNoUsers(self):
     """Test the user add form is rendered properly without users."""
     # Disabling the protected access check here intentionally so we can test a
     # private method.
     # pylint: disable=protected-access
     add_users_template = user._RenderAddUsersTemplate([])
     no_user_string = 'No users found. Try another query below.'
     self.assertTrue(no_user_string in add_users_template)
     self.assertTrue('xsrf' in add_users_template)
     self.assertTrue('An error occurred while' not in add_users_template)