Skip to content

Instantly share code, notes, and snippets.

@vorushin
Created July 30, 2010 20:25
Show Gist options
  • Save vorushin/501251 to your computer and use it in GitHub Desktop.
Save vorushin/501251 to your computer and use it in GitHub Desktop.
from django.core.urlresolvers import reverse
from django.test import TestCase
class Test(TestCase):
def test_api(self):
response = self.client.post(reverse('vk.views.start_wall_post'), {})
self.assertContains(response, 'errors')
response = self.client.post(reverse('vk.views.start_wall_post'),
{'image': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlgAAAEsCAYAAAAfPc2WAAAO60lEQVR4Ae3WMQ0A',
'server_url': 'http://example.com', 'sender_id': 111, 'wall_id': 222})
self.assertNotContains(response, 'errors')
response = self.client.post(reverse('vk.views.confirm_wall_post'), {})
self.assertContains(response, 'errors')
response = self.client.post(reverse('vk.views.confirm_wall_post'),
{'post_id': 1})
self.assertNotContains(response, 'errors')
response = self.client.get(reverse('vk.views.wall_post', args=[100]))
self.assertContains(response, 'errors')
response = self.client.get(reverse('vk.views.wall_post', args=[1]))
self.assertNotContains(response, 'errors')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment