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

    print "Resetting CRITs configuration settings."
    CRITsConfig.drop_collection();

    crits_config = CRITsConfig();
    crits_config.save();
示例#2
0
def clean_db():
    """
    Clean up the DB after testing.
    """

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

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