def test_get_osm_data_kwargs(self):
        """
        Test get_osm_data_kwargs returns correct kwargs for a merged dataset.
        """
        merged_dataset = self._create_merged_dataset()
        merged_xform = MergedXForm.objects.get(pk=merged_dataset['id'])
        pks = [_ for _ in merged_xform.xforms.values_list('id', flat=True)]
        kwargs = get_osm_data_kwargs(merged_xform)
        self.assertEqual(kwargs, {
            'instance__deleted_at__isnull': True,
            'instance__xform_id__in': pks
        })

        xform = merged_xform.xforms.all()[0]
        kwargs = get_osm_data_kwargs(xform)
        self.assertEqual(kwargs, {
            'instance__deleted_at__isnull': True,
            'instance__xform_id': xform.pk
        })
Ejemplo n.º 2
0
    def test_get_osm_data_kwargs(self):
        """
        Test get_osm_data_kwargs returns correct kwargs for a merged dataset.
        """
        merged_dataset = self._create_merged_dataset()
        merged_xform = MergedXForm.objects.get(pk=merged_dataset['id'])
        pks = [_ for _ in merged_xform.xforms.values_list('id', flat=True)]
        kwargs = get_osm_data_kwargs(merged_xform)
        self.assertEqual(kwargs, {
            'instance__deleted_at__isnull': True,
            'instance__xform_id__in': pks
        })

        xform = merged_xform.xforms.all()[0]
        kwargs = get_osm_data_kwargs(xform)
        self.assertEqual(kwargs, {
            'instance__deleted_at__isnull': True,
            'instance__xform_id': xform.pk
        })