diff options
author | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2012-12-21 00:27:59 +0100 |
---|---|---|
committer | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2012-12-21 00:30:48 +0100 |
commit | 7e55bcb898d37010a5e9bd8a666cd3ddfa63de33 (patch) | |
tree | b15eb178927eeb3e418ed3333e265ce65932e6f2 /mediagoblin/tests/test_tests.py | |
parent | 5c99cd01a70f2d597ac7669e8d944ddf79b05281 (diff) | |
download | mediagoblin-7e55bcb898d37010a5e9bd8a666cd3ddfa63de33.tar.lz mediagoblin-7e55bcb898d37010a5e9bd8a666cd3ddfa63de33.tar.xz mediagoblin-7e55bcb898d37010a5e9bd8a666cd3ddfa63de33.zip |
Fix up tests
empty find() queries would not work anymore with the simplified .find
compatability code, so remove these and use proper sqlalchemy in the
tests.
The storage test failed because my virtualenv environment ran
mediagoblin/local/mediagoblin/tests/test_storage.py and somehow decided
the 2 classes are different objects. Just test against the full class name.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Diffstat (limited to 'mediagoblin/tests/test_tests.py')
-rw-r--r-- | mediagoblin/tests/test_tests.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mediagoblin/tests/test_tests.py b/mediagoblin/tests/test_tests.py index 20832ac7..2228d15a 100644 --- a/mediagoblin/tests/test_tests.py +++ b/mediagoblin/tests/test_tests.py @@ -14,9 +14,9 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -from mediagoblin.tests.tools import get_test_app - from mediagoblin import mg_globals +from mediagoblin.tests.tools import get_test_app +from mediagoblin.db.sql.models import User def test_get_test_app_wipes_db(): @@ -24,15 +24,15 @@ def test_get_test_app_wipes_db(): Make sure we get a fresh database on every wipe :) """ get_test_app() - assert mg_globals.database.User.find().count() == 0 + assert User.query.count() == 0 new_user = mg_globals.database.User() new_user.username = u'lolcat' new_user.email = u'lol@cats.example.org' new_user.pw_hash = u'pretend_this_is_a_hash' new_user.save() - assert mg_globals.database.User.find().count() == 1 + assert User.query.count() == 1 get_test_app() - assert mg_globals.database.User.find().count() == 0 + assert User.query.count() == 0 |