def test_set_identifier_allready_set(self): """ If the motion already has a identifier, the method does nothing. """ motion = Motion(identifier="My test identifier") motion.set_identifier() self.assertEqual(motion.identifier, "My test identifier")
def test_set_identifier_allready_set(self): """ If the motion already has a identifier, the method does nothing. """ motion = Motion(identifier='My test identifier') motion.set_identifier() self.assertEqual(motion.identifier, 'My test identifier')
def test_set_identifier_manually(self): """ If the config is set to manually, the method does nothing. """ config["motions_identifier"] = "manually" motion = Motion() motion.set_identifier() # If the identifier should be set manually, the method does nothing self.assertIsNone(motion.identifier)
def test_set_identifier_manually(self): """ If the config is set to manually, the method does nothing. """ config['motions_identifier'] = 'manually' motion = Motion() motion.set_identifier() # If the identifier should be set manually, the method does nothing self.assertIsNone(motion.identifier)
def test_set_identifier_manually(self): """ If the config is set to manually, the method does nothing. """ config['motions_identifier'] = 'manually' get_redis_connection("default").flushall() motion = Motion() motion.set_identifier() # If the identifier should be set manually, the method does nothing self.assertIsNone(motion.identifier)
def test_set_identifier_amendment(self): """ If the motion is an amendment, the identifier is the identifier from the parent + a suffix. """ config["motions_amendments_enabled"] = True self.motion.identifier = "Parent identifier" self.motion.save() motion = Motion(parent=self.motion) motion.set_identifier() self.assertEqual(motion.identifier, "Parent identifier A 1")
def test_set_identifier_amendment(self): """ If the motion is an amendment, the identifier is the identifier from the parent + a suffix. """ config['motions_amendments_enabled'] = True self.motion.identifier = 'Parent identifier' self.motion.save() motion = Motion(parent=self.motion) motion.set_identifier() self.assertEqual(motion.identifier, 'Parent identifier A 1')
def test_set_identifier_second_amendment(self): """ If a motion has already an amendment, the second motion gets another identifier. """ config["motions_amendments_enabled"] = True self.motion.identifier = "Parent identifier" self.motion.save() Motion.objects.create(title="Amendment1", parent=self.motion) motion = Motion(parent=self.motion) motion.set_identifier() self.assertEqual(motion.identifier, "Parent identifier A 2")
def test_set_identifier_second_amendment(self): """ If a motion has already an amendment, the second motion gets another identifier. """ config['motions_amendments_enabled'] = True self.motion.identifier = 'Parent identifier' self.motion.save() Motion.objects.create(title='Amendment1', parent=self.motion) motion = Motion(parent=self.motion) motion.set_identifier() self.assertEqual(motion.identifier, 'Parent identifier A 2')
def test_set_identifier_second_amendment(self): """ If a motion has already an amendment, the second motion gets another identifier. """ config['motions_amendments_enabled'] = True self.motion.identifier = 'Parent identifier' self.motion.save() Motion.objects.create(title='Amendment1', parent=self.motion) motion = Motion(parent=self.motion) motion.set_identifier() self.assertEqual(motion.identifier, 'Parent identifier - 2')
def test_set_identifier_second_amendment(self): """ If a motion has already an amendment, the second motion gets another identifier. """ config["motions_amendments_enabled"] = True self.motion.identifier = "Parent identifier" self.motion.save() Motion.objects.create(title="Amendment1", parent=self.motion) motion = Motion(parent=self.motion) motion.set_identifier() self.assertEqual(motion.identifier, "Parent identifier - 2")
def test_set_identifier_amendment(self): """ If the motion is an amendment, the identifier is the identifier from the parent + a suffix. """ config["motions_amendments_enabled"] = True config["motions_identifier_with_blank"] = False self.motion.identifier = "Parent identifier" self.motion.save() motion = Motion(parent=self.motion) motion.set_identifier() self.assertEqual(motion.identifier, "Parent identifier-1")
def test_set_identifier_amendment(self): """ If the motion is an amendment, the identifier is the identifier from the parent + a suffix. """ config['motions_amendments_enabled'] = True self.motion.identifier = 'Parent identifier' self.motion.save() get_redis_connection("default").flushall() motion = Motion(parent=self.motion) motion.set_identifier() self.assertEqual(motion.identifier, 'Parent identifier - 1')