Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(9)  |  Derive(0)  |  Import(0)

src/d/j/django-concurrency-HEAD/tests/test_admin_edit.py   django-concurrency(Download)
        form['username'] = 'CHAR'
        res = form.submit().follow()
        self.assertTrue(SimpleConcurrentModel.objects.filter(username='CHAR').exists())
        self.assertGreater(SimpleConcurrentModel.objects.get(username='CHAR').version, 0)
 
 
        self.assertIn('original', res.context)
        self.assertTrue(res.context['adminform'].form.errors,
                        res.context['adminform'].form.errors)
        self.assertIn(_('Record Modified'),
        form['username'] = 'CHAR'
        res = form.submit().follow()
        self.assertTrue(SimpleConcurrentModel.objects.filter(username='CHAR').exists())
        self.assertGreater(SimpleConcurrentModel.objects.get(username='CHAR').version, 0)
 
        form['username'] = username
        res = form.submit().follow()
        self.assertTrue(SimpleConcurrentModel.objects.filter(username=username).exists())
        self.assertGreater(SimpleConcurrentModel.objects.get(username=username).version, 0)
 
        res = form.submit()
        self.assertIn('original', res.context)
        self.assertTrue(res.context['adminform'].form.errors,
                        res.context['adminform'].form.errors)
        self.assertIn(_('Record Modified'),

src/d/j/django-concurrency-HEAD/tests/test_admin_list_editable.py   django-concurrency(Download)
        form['form-0-username'] = 'CHAR'
        res = form.submit('_save').follow()
        self.assertTrue(self.TARGET.objects.filter(username='CHAR').exists())
 
    def test_concurrency_policy_abort(self):
                res = form.submit('_save')
 
            self.assertTrue(self.TARGET.objects.filter(username=SENTINEL).exists())
            self.assertFalse(self.TARGET.objects.filter(username='CHAR').exists())
 
            form['form-0-username'] = 'CHAR'
            res = form.submit('_save').follow()
            self.assertTrue(self.TARGET.objects.filter(username=SENTINEL).exists())
            self.assertFalse(self.TARGET.objects.filter(username='CHAR').exists())