# HG changeset patch # User Johannes Bornhold # Date 2016-05-25 11:38:59 # Node ID 0aab9a51cde0b9d4a5fe0e1cbc3c40ad4c325418 # Parent 2451deb0e4e6662e25ed7bc01b15429ddc6438ca pytest: Remove oauth related tests. diff --git a/rhodecode/tests/functional/test_admin_my_account.py b/rhodecode/tests/functional/test_admin_my_account.py --- a/rhodecode/tests/functional/test_admin_my_account.py +++ b/rhodecode/tests/functional/test_admin_my_account.py @@ -339,53 +339,3 @@ class TestMyAccountController(TestContro new_password_hash = response.session['rhodecode_user']['password'] assert old_password_hash != new_password_hash - - def test_my_account_oauth_tokens_empty(self): - usr = self.log_user('test_regular2', 'test12') - User.get(usr['user_id']) - response = self.app.get(url('my_account_oauth')) - response.mustcontain(no=['Connect with GitHub']) - response.mustcontain('You have no accounts linked yet') - - def test_my_account_oauth_tokens_present(self): - from rhodecode.model.db import ExternalIdentity - usr = self.log_user('test_regular2', 'test12') - user = User.get(usr['user_id']) - - ex_identity = ExternalIdentity() - ex_identity.external_id = '55' - ex_identity.provider_name = 'twitter' - ex_identity.local_user_id = user.user_id - db_session = Session() - db_session.add(ex_identity) - Session.flush() - db_session.commit() - try: - response = self.app.get(url('my_account_oauth')) - response.mustcontain('twitter', - no=['You have no accounts linked yet']) - finally: - db_session = Session() - db_session.delete(ex_identity) - db_session.commit() - - def test_my_account_oauth_tokens_delete(self): - from rhodecode.model.db import ExternalIdentity - usr = self.log_user('test_regular2', 'test12') - user = User.get(usr['user_id']) - - ex_identity = ExternalIdentity() - ex_identity.external_id = '99' - ex_identity.provider_name = 'twitter' - ex_identity.local_user_id = user.user_id - db_session = Session() - db_session.add(ex_identity) - Session.flush() - db_session.commit() - assert ExternalIdentity.query().count() == 1 - response = self.app.post( - url('my_account_oauth', provider_name='twitter', - external_id='99'), - {'_method': 'delete', 'csrf_token': self.csrf_token}) - assert_session_flash(response, 'OAuth token successfully deleted') - assert ExternalIdentity.query().count() == 0