Beispiel #1
0
    def run(self, word):
        if word is None:
            raise ValueError('word is None:  python manage.py check  --word="あいう"')

        # insert
        InspectionWord.register(INSPECTION_WORD)

        # ck
        if InspectionWord.inspection(word):
            print('True NGワードに該当')
            return
        if inspection_affiliate(word):
            print('True アフィチェックに該当')
            return
        print('False 該当せず')
    def run(self, word):
        if word is None:
            raise ValueError(
                'word is None:  python manage.py check  --word="あいう"')

        # insert
        InspectionWord.register(INSPECTION_WORD)

        # ck
        if InspectionWord.inspection(word):
            print('True NGワードに該当')
            return
        if inspection_affiliate(word):
            print('True アフィチェックに該当')
            return
        print('False 該当せず')
def tests_afi():
    word = 'あんぱん'
    assert inspection_affiliate(word) == False

    word = 'あふぃ'
    assert inspection_affiliate(word)

    word = 'アフィ'
    assert inspection_affiliate(word)

    word = 'アマルフィ'
    assert inspection_affiliate(word)

    word = 'アまるふぃ'
    assert inspection_affiliate(word)

    word = 'あかん、ゴムゴムのるふぃ'
    assert inspection_affiliate(word)

    word = 'あかん、ゴムゴムのルフィ'
    assert inspection_affiliate(word)

    word = 'あかん、ゴムゴムのルフーーィ'
    assert inspection_affiliate(word)

    word = 'クリック'
    assert inspection_affiliate(word)

    word = 'くりっく'
    assert inspection_affiliate(word)

    word = '広告'
    assert inspection_affiliate(word)