Example #1
0
    def test_remove_incomplete_accounts(self, datetime_mock):
        """Test remove incomplete accounts."""
        complete_user = UserFactory.create(date_joined=datetime(2012, 01, 01))
        complete_vouched_user = UserFactory.create(date_joined=datetime(2013, 01, 01), userprofile={"is_vouched": True})
        incomplete_user_not_old = UserFactory.create(date_joined=datetime(2013, 01, 01), userprofile={"full_name": ""})
        incomplete_user_old = UserFactory.create(date_joined=datetime(2012, 01, 01), userprofile={"full_name": ""})

        datetime_mock.now.return_value = datetime(2013, 01, 01)

        remove_incomplete_accounts(days=0)
        ok_(User.objects.filter(id=complete_user.id).exists())
        ok_(User.objects.filter(id=complete_vouched_user.id).exists())
        ok_(User.objects.filter(id=incomplete_user_not_old.id).exists())
        ok_(not User.objects.filter(id=incomplete_user_old.id).exists())
Example #2
0
    def test_remove_incomplete_accounts(self):
        """Test remove incomplete accounts."""
        complete_user = UserFactory.create()
        complete_vouched_user = UserFactory.create(
            userprofile={'is_vouched': True})
        incomplete_user_not_old = UserFactory.create(
            userprofile={'full_name': ''})
        incomplete_user_old = UserFactory.create(
            date_joined=datetime(2012, 01, 01),
            userprofile={'full_name': ''})

        remove_incomplete_accounts(days=0)
        ok_(User.objects.filter(id=complete_user.id).exists())
        ok_(User.objects.filter(id=complete_vouched_user.id).exists())
        ok_(User.objects.filter(id=incomplete_user_not_old.id).exists())
        ok_(not User.objects.filter(id=incomplete_user_old.id).exists())
Example #3
0
    def test_remove_incomplete_accounts(self):
        """Test remove incomplete accounts."""
        complete_user = UserFactory.create()
        complete_vouched_user = UserFactory.create(
            userprofile={'is_vouched': True})
        incomplete_user_not_old = UserFactory.create(
            userprofile={'full_name': ''})
        incomplete_user_old = UserFactory.create(date_joined=datetime(
            2012, 01, 01),
                                                 userprofile={'full_name': ''})

        remove_incomplete_accounts(days=0)
        ok_(User.objects.filter(id=complete_user.id).exists())
        ok_(User.objects.filter(id=complete_vouched_user.id).exists())
        ok_(User.objects.filter(id=incomplete_user_not_old.id).exists())
        ok_(not User.objects.filter(id=incomplete_user_old.id).exists())
Example #4
0
    def test_remove_incomplete_accounts(self, datetime_mock):
        """Test remove incomplete accounts."""
        complete_user = UserFactory.create(vouched=False,
                                           date_joined=datetime(2012, 01, 01))
        complete_vouched_user = UserFactory.create(date_joined=datetime(2013, 01, 01))
        incomplete_user_not_old = UserFactory.create(date_joined=datetime(2013, 01, 01),
                                                     userprofile={'full_name': ''})
        incomplete_user_old = UserFactory.create(date_joined=datetime(2012, 01, 01),
                                                 userprofile={'full_name': ''})

        datetime_mock.now.return_value = datetime(2013, 01, 01)

        remove_incomplete_accounts(days=0)
        ok_(User.objects.filter(id=complete_user.id).exists())
        ok_(User.objects.filter(id=complete_vouched_user.id).exists())
        ok_(User.objects.filter(id=incomplete_user_not_old.id).exists())
        ok_(not User.objects.filter(id=incomplete_user_old.id).exists())
 def test_remove_incomplete_accounts(self):
     """Test remove incomplete accounts."""
     user = UserFactory.create(userprofile={'full_name': ''})
     remove_incomplete_accounts(days=0)
     ok_(not User.objects.filter(id=user.id).exists())