Ejemplo n.º 1
0
def _create_individual(request):
    if not _post_is_valid(request):
        return _return_with_context(request)

    descriptionFields = _getDescriptionFields(request)
    individual.create(request.POST.get('nickname'), request.POST.get('taxon'),
                      description=descriptionFields[0] or None, descriptionURL=descriptionFields[1] or None)
    messages.add_message(request, messages.INFO, _('Lintu luotu onnistuneesti!'))
Ejemplo n.º 2
0
    def setUp(self):
        indiv = {
            "nickname": "Lintuli",
            "taxon": "test test"
        }
        indiv2 = {
            "nickname": "Varpuli",
            "taxon": "test test2"
        }

        self.ind = individual.create(**indiv)
        self.ind2 = individual.create(**indiv2)
Ejemplo n.º 3
0
 def test_post_with_targets(self):
     I = individual.create("test", "test")
     I2 = individual.create("test", "test")
     targets = []
     targets.append(I.id)
     targets.append(I2.id)
     postdata = {
         "content": "p>test</p>",
         "language": "en",
         "targets": json.dumps(targets),
         "eventDate": "2016-3-1",
         "publishDate": "2016-3-1",
         "title": "test3"
     }
     response = self.c.post(_URL, postdata)
     self.assertEquals(len(news.find()), 3)
    def setUp(self):
        DeviceIndividual.delete_all()
        self.D = device.create(**{
            "deviceManufacturerID": "ABCD1234567",
            "deviceType": "Type",
            "deviceManufacturer": "Manufacturer",
            "dateCreated": "2015-09-29T14:00:00+03:00",
            "dateEdited": "2015-09-29T14:00:00+03:00"
        })
        self.D2 = device.create(**{
            "deviceManufacturerID": "ABCD1234568",
            "deviceType": "Type",
            "deviceManufacturer": "Manufacturer",
            "dateCreated": "2015-09-29T14:00:00+03:00",
            "dateEdited": "2015-09-29T14:00:00+03:00"
        })

        self.I = individual.create("Lintu1", "test")
        self.I2 = individual.create("Lintu2", "test")
Ejemplo n.º 5
0
 def setUp(self):
     self.c = Client()
     self.A = device.create("type","Manufacturer1",'1234TEST_A',"2015-10-27T16:32:01+00:00", "2015-10-27T16:32:01+00:00")
     self.B = device.create("type","Manufacturer2","1234TEST_B","2015-10-27T16:32:01+00:00", "2015-10-27T16:32:01+00:00")
     self.indiv = individual.create("Lintu1","Tax")