Ejemplo n.º 1
0
    def test_delete(self):
        expected = "blubber"

        m_aa = Mock()
        m_users = Mock()
        m_users.delete.return_value = expected
        m_roles = Mock()

        result = users.delete(m_aa, m_users, m_roles, 'test_user')

        m_aa.require_admin.assert_called_with()
        m_users.delete.assert_called_with('test_user')
        m_roles.remove_user_from_all.assert_called_with('test_user')
        self.assertEquals(result, expected)
Ejemplo n.º 2
0
    def test_delete(self):
        expected = "blubber"

        m_aa = Mock()
        m_users = Mock()
        m_users.delete.return_value = expected
        m_roles = Mock()

        result = users.delete(m_aa, m_users, m_roles, 'test_user')

        m_aa.require_admin.assert_called_with()
        m_users.delete.assert_called_with('test_user')
        m_roles.remove_user_from_all.assert_called_with('test_user')
        self.assertEquals(result, expected)
Ejemplo n.º 3
0
    def test_delete_self(self):
        expected = "blubber"

        m_aa = Mock()
        m_aa.get_user.return_value = 'self_user'
        m_users = Mock()
        m_users.delete.return_value = expected
        m_roles = Mock()

        result = users.delete(m_aa, m_users, m_roles, '_self')

        m_aa.get_user.assert_called_with()
        m_users.delete.assert_called_with('self_user')
        m_roles.remove_user_from_all.assert_called_with('self_user')
        self.assertEquals(result, expected)
Ejemplo n.º 4
0
    def test_delete_self(self):
        expected = "blubber"

        m_aa = Mock()
        m_aa.get_user.return_value = 'self_user'
        m_users = Mock()
        m_users.delete.return_value = expected
        m_roles = Mock()

        result = users.delete(m_aa, m_users, m_roles, '_self')

        m_aa.get_user.assert_called_with()
        m_users.delete.assert_called_with('self_user')
        m_roles.remove_user_from_all.assert_called_with('self_user')
        self.assertEquals(result, expected)