Skip to content

Commit

Permalink
fix some merge conflict issues
Browse files Browse the repository at this point in the history
  • Loading branch information
squirrelo committed Jun 12, 2014
1 parent 9007a91 commit 18c2edf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
13 changes: 10 additions & 3 deletions qiita_db/test/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

from unittest import TestCase, main

from qiita_core.exceptions import (IncompetentQiitaDeveloperError,
IncorrectEmailError, IncorrectPasswordError)
from qiita_core.exceptions import IncorrectEmailError, IncorrectPasswordError
from qiita_core.util import qiita_test_checker
from qiita_db.user import User
from qiita_db.sql_connection import SQLConnectionHandler
from qiita_db.exceptions import QiitaDBDuplicateError, QiitaDBColumnError
from qiita_db.exceptions import (QiitaDBDuplicateError, QiitaDBColumnError,
QiitaDBUnknownIDError)


@qiita_test_checker()
Expand All @@ -31,6 +31,13 @@ def setUp(self):
'phone': '111-222-3344'
}

def test_instantiate_user(self):
User('admin@foo.bar')

def test_instantiate_unknown_user(self):
with self.assertRaises(QiitaDBUnknownIDError):
User('FAIL@OMG.bar')

def _check_correct_info(self, obs, exp):
self.assertEqual(set(exp.keys()), set(obs.keys()))
for key in exp:
Expand Down
21 changes: 0 additions & 21 deletions qiita_db/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,27 +216,6 @@ def create(cls, email, password, info=None):
conn_handler.execute(sql, values)
return cls(email)

def _check_id(self, id_, conn_handler=None):
r"""Check that the provided ID actually exists on the database
Parameters
----------
id_ : str
The ID to test
conn_handler
The connection handler object connected to the DB
Notes
-----
This function overwrites the base function, as sql layout doesn't
follow the same conventions done in the other tables.
"""
conn_handler = (conn_handler if conn_handler is not None
else SQLConnectionHandler())
return conn_handler.execute_fetchone(
"SELECT EXISTS(SELECT * FROM qiita.qiita_user WHERE "
"email = %s)", (id_, ))[0]

# ---properties---

@property
Expand Down

0 comments on commit 18c2edf

Please sign in to comment.