Ejemplo n.º 1
0
 def test_send(self):
     app = Webapp.objects.get(pk=337141)
     app.privacy_policy = 'privacy policy text'
     field = LargeTextField(view_name='app-privacy-policy-detail')
     field.context = {'request': self.request}
     url = field.field_to_native(app, None)
     self.assertApiUrlEqual(url, '/apps/app/337141/privacy/')
Ejemplo n.º 2
0
 def test_receive(self):
     data = 'privacy policy text'
     into = {}
     field = LargeTextField(view_name='app-privacy-policy-detail')
     field.context = {'request': self.request}
     field.field_from_native({'field_name': data}, None, 'field_name', into)
     eq_(into['field_name'], data)
Ejemplo n.º 3
0
 def test_receive(self):
     data = "privacy policy text"
     into = {}
     field = LargeTextField(view_name="app-privacy-policy-detail")
     field.context = {"request": self.request}
     field.field_from_native({"field_name": data}, None, "field_name", into)
     eq_(into["field_name"], data)
Ejemplo n.º 4
0
 def test_send(self):
     app = Webapp.objects.get(pk=337141)
     app.privacy_policy = 'privacy policy text'
     field = LargeTextField(view_name='app-privacy-policy-detail',
                            queryset=Webapp.objects)
     field.context = {'request': self.request}
     url = field.to_representation(app)
     self.assertApiUrlEqual(url, '/apps/app/337141/privacy/')
Ejemplo n.º 5
0
 def test_receive(self):
     data = 'privacy policy text'
     field = LargeTextField(view_name='app-privacy-policy-detail',
                            queryset=Webapp.objects)
     field.context = {'request': self.request}
     eq_(field.to_internal_value(data), data)