コード例 #1
0
ファイル: test_session.py プロジェクト: adlius/osf.io
    def test_remove(self):
        session, session2 = Session(data={'auth_user_id': '123ab'}), Session(data={'auth_user_id': 'ab123'})
        session.save()
        session2.save()

        assert Session.objects.count() == 2  # sanity check
        Session.remove(Q('data.auth_user_id', 'eq', '123ab'))
        assert Session.objects.count() == 1
コード例 #2
0
    def test_remove(self):
        session, session2 = Session(data={'auth_user_id': '123ab'}), Session(data={'auth_user_id': 'ab123'})
        session.save()
        session2.save()

        assert Session.objects.count() == 2  # sanity check
        Session.remove(Q('data.auth_user_id', 'eq', '123ab'))
        assert Session.objects.count() == 1
コード例 #3
0
ファイル: utils.py プロジェクト: nakajimahiroyuki/osf.io
def remove_sessions_for_user(user):
    """
    Permanently remove all stored sessions for the user from the DB.

    :param user: User
    :return:
    """
    from osf.models import Session

    Session.remove(Q('data.auth_user_id', 'eq', user._id))
コード例 #4
0
ファイル: test_session.py プロジェクト: darshanman40/osf.io
 def tearDown(self, *args, **kwargs):
     super(SessionUtilsTestCase, self).tearDown(*args, **kwargs)
     User.remove()
     Session.remove()
コード例 #5
0
ファイル: test_session.py プロジェクト: adlius/osf.io
 def tearDown(self, *args, **kwargs):
     super(SessionUtilsTestCase, self).tearDown(*args, **kwargs)
     User.remove()
     Session.remove()