示例#1
0
def force_reset_config():
    """
    Resets the values for the CRIPTsConfig class by dropping the
    database collection and then saving a new default CRIPTsConfig.
    """

    print "Resetting CRIPTs configuration settings."
    CRIPTsConfig.drop_collection();

    cripts_config = CRIPTsConfig();
    cripts_config.save();
示例#2
0
文件: tests.py 项目: lakiw/cripts
def clean_db():
    """
    Clean up the DB after testing.
    """

    src = SourceAccess.objects(name=TSRC).first()
    if src:
        src.delete()
    user = CRIPTsUser.objects(username=TUSER_NAME).first()
    if user:
        user.delete()
    TestObject.drop_collection()
    TestSourceObject.drop_collection()
    CRIPTsConfig.drop_collection()
示例#3
0
文件: tests.py 项目: lakiw/cripts
def clean_db():
    """
    Clean up the DB after testing.
    """

    src = SourceAccess.objects(name=TSRC).first()
    if src:
        src.delete()
    user = CRIPTsUser.objects(username=TUSER_NAME).first()
    if user:
        user.delete()
    TestObject.drop_collection()
    TestSourceObject.drop_collection()
    CRIPTsConfig.drop_collection()