def test_automated_spam_reports_skip(self): spam_user = UserFactory.create(vouched=True).userprofile AbuseReport.objects.create(profile=spam_user) eq_(AbuseReport.objects.all().count(), 1) delete_reported_spam_accounts() eq_(AbuseReport.objects.all().count(), 1) eq_(User.objects.filter(email=spam_user.email).count(), 1)
def test_automated_spam_reports_skip(self): spam_user = UserFactory.create(vouched=True).userprofile AbuseReport.objects.create( profile=spam_user ) eq_(AbuseReport.objects.all().count(), 1) delete_reported_spam_accounts() eq_(AbuseReport.objects.all().count(), 1) eq_(User.objects.filter(email=spam_user.email).count(), 1)
def test_automated_spam_reports_delete(self): spam_user = UserFactory.create(vouched=False).userprofile AbuseReport.objects.create( profile=spam_user, is_akismet=True, ) ok_(not spam_user.skills.all().exists()) eq_(AbuseReport.objects.all().count(), 1) delete_reported_spam_accounts() eq_(AbuseReport.objects.all().count(), 1) eq_(User.objects.filter(email=spam_user.email).count(), 1)
def test_manual_spam_reports_unvouched_delete(self): spam_user = UserFactory.create(vouched=False).userprofile reporter = UserFactory.create().userprofile AbuseReport.objects.create( profile=spam_user, reporter=reporter, ) eq_(AbuseReport.objects.all().count(), 1) eq_(User.objects.filter(email=spam_user.email).count(), 1) delete_reported_spam_accounts() eq_(AbuseReport.objects.all().count(), 0) eq_(User.objects.filter(email=spam_user.email).count(), 0)
def test_manual_spam_reports_unvouched_delete(self): spam_user = UserFactory.create(vouched=False).userprofile reporter = UserFactory.create().userprofile AbuseReport.objects.create( profile=spam_user, reporter=reporter, ) eq_(AbuseReport.objects.all().count(), 1) eq_(User.objects.filter(email=spam_user.email).count(), 1) delete_reported_spam_accounts() eq_(AbuseReport.objects.all().count(), 0) eq_(User.objects.filter(email=spam_user.email).count(), 0)