These are chat archives for django/django

23rd
Oct 2017
kpagcha
@kpagcha
Oct 23 2017 09:44
I have multiple TestCase classes using the same fixtures and effectively using the same data which is set up in setUpTestData. The problem is that fixtures are loaded and data is set up separately for each class. Is it possible to run this only once for all those classes?
Anish Shrestha
@annshress
Oct 23 2017 10:16
@kpagcha Does It show same behaviour on inheritance?
MyTestCase(TestCase):
  fixtures = [...]

TestCaseOne(MyTestCase):
   ...

TestCaseTwo(MyTestCase):
  ...
kpagcha
@kpagcha
Oct 23 2017 10:43
@annshress yeah when inheriting, fixtures and data load are executed once for TestCaseOne and once for TestCaseTwo.
Touzi-Mortadha
@Touzi-Mortadha
Oct 23 2017 11:25
hi
can some one tell me why this didn't work !
@user_passes_test(lambda u: u.is_superuser)
@method_decorator(login_required, name='dispatch')
class UpdateAdminView(TemplateView):
template_name = "admin.html"
@user_passes_test(lambda u: u.is_superuser) @method_decorator(login_required, name='dispatch') class UpdateAdminView(TemplateView): template_name = "admin.html"
Julian Salas
@DevJulianSalas
Oct 23 2017 16:50
What's your error can you post your traceback?
Cristian Samaniego
@chrisRubiano
Oct 23 2017 17:36
@annshress thank you! i was missing the enctype part and i wasnt giving the request.FILES parameter to the form