Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.core.urlresolvers import reverse
- from django.test import TestCase, Client
- from django.contrib.admin.sites import AdminSite
- from gloodny.models import *
- from django.forms.models import model_to_dict
- class ChangeHistoryTests(TestCase):
- fixtures = ['init_gloodny.json']
- def setUp(self):
- self.site = AdminSite()
- self.meal = Meal.objects.first()
- self.client = Client()
- self.client.login(username='root', password='qwerty1003')
- def test_change_meal(self):
- """Check that the endpoint correctly adds a voucher."""
- print self.meal
- url = reverse('admin:gloodny_meal_change', args=(self.meal.id,))
- data = model_to_dict(self.meal)
- data['_save'] = 'save'
- data['title'] = 'NEW TITLE'
- response = self.client.post(url, data)
- print self.meal
- self.assertEqual(1, 1)
Add Comment
Please, Sign In to add comment