def test_user_passesCertification_without_voucher(self):
        user_id = 'test_user_passes_id'
        level_name = 'test_user_passes_level_name'
        certification_level = 'test_user_passes_certification_level'
        level_stars = 1

        #given
        user = User(user_id, certification_level)
        level = Level(certification_level, level_name, level_stars)

        #when
        response = user.passesCertification(level)

        #then
        assert response == False
        assert user.profile_update_date == None
    def test_user_passesCertification_already_saved(self):
        user_id = 'test_user_passes_id'
        level_name = 'test_user_passes_level_name'
        certification_level = 'test_user_passes_certification_level'
        level_stars = 1
        voucher_code = 'test_user_passes_voucher_code'
        attribuated_date = 'test_user_passes_attribuated_date'
        profile_update_date = 'test_user_passes_profile_update_date'

        #given
        user = User(user_id, certification_level, voucher_code, attribuated_date, profile_update_date)
        level = Level(certification_level, level_name, level_stars)

        #when
        response = user.passesCertification(level)

        #then
        assert response == False
        assert user.profile_update_date == profile_update_date
    def test_user_passesCertification(self):
        user_id = 'test_user_passes_id'
        level_id = 'test_level_passes_id'
        level_name = 'test_user_passes_level_name'
        level_stars = 1
        voucher_code = 'test_user_passes_voucher_code'

        #given
        self.user_table.put_item(Item={'user_id': user_id, 'certification_level': level_id, 'voucher_code': voucher_code})
        self.level_table.put_item(Item={'id': level_id, 'name': level_name})
        user = User(user_id, level_id, voucher_code)
        level = Level(level_id, level_name, level_stars)

        #when
        response = user.passesCertification(level)

        #then
        assert response == True
        assert user.profile_update_date == time.strftime('%d/%m/%Y',time.localtime())