def test_badge_awarded_on_content_percent(self):
        user = self._get_user()

        b = get_badge('250-words-by-percent')

        # Post 5 words in progress...
        GuestbookEntry.objects.create(creator=user,
            message="A few words to start")
        ok_(not b.is_awarded_to(user))
        eq_((5.0 / 250.0) * 100.0, b.progress_for(user).percent)

        # Post 5 more words in progress...
        GuestbookEntry.objects.create(creator=user,
            message="A few more words posted")
        ok_(not b.is_awarded_to(user))
        eq_((10.0 / 250.0) * 100.0, b.progress_for(user).percent)

        # Post 90 more...
        msg = ' '.join('lots of words that repeat' for x in range(18))
        GuestbookEntry.objects.create(creator=user, message=msg)
        ok_(not b.is_awarded_to(user))
        eq_((100.0 / 250.0) * 100.0, b.progress_for(user).percent)

        # And 150 more for the finale...
        msg = ' '.join('lots of words that repeat' for x in range(30))
        GuestbookEntry.objects.create(creator=user, message=msg)

        # Should result in a badge award and reset progress.
        ok_(b.is_awarded_to(user))
        eq_(0, b.progress_for(user).percent)

        # But, just checking the reset percent shouldn't create a new DB row.
        eq_(0, Progress.objects.filter(user=user, badge=b).count())
tree unix command replacement.
dataset/ETHPy150Open mozilla/django-badger/badger/tests/test_badges_py.py/BadgesPyTest.test_badge_awarded_on_content_percent--crossover with--dataset/ETHPy150Open unbit/sftpclone/sftpclone/t/utils.py/list_files