def test_create_default_user(self): "Test that the default user is created correctly" create_tables() create_default_user(u'creosote', u'secret') retrieved_user = User.by_email_address(u'*****@*****.**' % u'creosote') assert retrieved_user assert retrieved_user.user_name == u'creosote' assert retrieved_user.display_name == u'Default User' assert retrieved_user.password
def test_create_tables(self): """Test that model.create_tables correctly creates all database tables.""" self.assertRaises(OperationalError, User.by_user_name, u'test') create_tables() assert _create_test_user() create_tables() assert User.by_user_name(u'creosote') create_tables(drop_all=True) user = User.by_user_name(u'creosote') assert user is None