예제 #1
0
파일: test_util.py 프로젝트: ianthe/pybossa
 def test_returns_true_for_reserved_name_for_account_blueprint(self):
     with self.app.app_context():
         reserved = util.is_reserved_name('account', 'register')
         assert reserved is True, reserved
         reserved = util.is_reserved_name('account', 'forgot-password')
         assert reserved is True, reserved
         reserved = util.is_reserved_name('account', 'profile')
         assert reserved is True, reserved
         reserved = util.is_reserved_name('account', 'signin')
         assert reserved is True, reserved
         reserved = util.is_reserved_name('account', 'reset-password')
         assert reserved is True, reserved
예제 #2
0
파일: test_util.py 프로젝트: ianthe/pybossa
 def test_returns_true_for_reserved_name_for_app_blueprint(self):
     with self.app.app_context():
         reserved = util.is_reserved_name('project', 'new')
         assert reserved is True, reserved
         reserved = util.is_reserved_name('project', 'category')
         assert reserved is True, reserved
         reserved = util.is_reserved_name('project', 'page')
         assert reserved is True, reserved
         reserved = util.is_reserved_name('project', 'draft')
         assert reserved is True, reserved
         reserved = util.is_reserved_name('project', 'published')
         assert reserved is True, reserved
예제 #3
0
파일: validator.py 프로젝트: Skytim/pybossa
 def __call__(self, form, field):
     if is_reserved_name(self.blueprint, field.data):
         raise ValidationError(self.message)
예제 #4
0
파일: validator.py 프로젝트: Save22/pybossa
 def __call__(self, form, field):
     if is_reserved_name(self.blueprint, field.data):
         raise ValidationError(self.message)
예제 #5
0
 def _validate_instance(self, project):
     if project.short_name and is_reserved_name('project',
                                                project.short_name):
         msg = "Project short_name is not valid, as it's used by the system."
         raise ValueError(msg)
예제 #6
0
파일: test_util.py 프로젝트: ianthe/pybossa
 def test_returns_false_for_empty_name_string(self):
     with self.app.app_context():
         reserved = util.is_reserved_name('account', '')
         assert reserved is False, reserved
예제 #7
0
파일: test_util.py 프로젝트: ianthe/pybossa
 def test_returns_false_for_valid_name_for_account_blueprint(self):
     with self.app.app_context():
         reserved = util.is_reserved_name('account', 'fulanito')
         assert reserved is False, reserved
         reserved = util.is_reserved_name('acount', 'profileFulanito')
         assert reserved is False, reserved
예제 #8
0
파일: test_util.py 프로젝트: ianthe/pybossa
 def test_returns_false_for_valid_name_for_app_blueprint(self):
     with self.app.app_context():
         reserved = util.is_reserved_name('project', 'test_project')
         assert reserved is False, reserved
         reserved = util.is_reserved_name('project', 'newProject')
         assert reserved is False, reserved
예제 #9
0
파일: project.py 프로젝트: TMoneyZ/pybossa
 def _validate_instance(self, project):
     if project.short_name and is_reserved_name('project', project.short_name):
         msg = "Project short_name is not valid, as it's used by the system."
         raise ValueError(msg)