Re: Create database objects for unit tests

2018-12-13 Thread Jakob Damgaard Møller
Look at this https://factoryboy.readthedocs.io/en/latest/ tor. 13. dec. 2018 kl. 09.15 skrev Alexander Lamas < alexander.g.la...@gmail.com>: > Hi all, > > Does anyone know where and how to implement the reading and execution of a > sql script file to create all database objects before run the

Custom Mixin for Mulitple Field Object Lookup in Django REST

2018-12-13 Thread Foobar
I have the following code which doesn't work: In models.py: class Unit(models.Model): unit_name = models.CharField(max_length=255) In views.py: class MultipleFieldLookupMixin(object): """ Apply this mixin to any view or viewset to get multiple field filtering based on a `lookup_fields`

Re: Create database objects for unit tests

2018-12-13 Thread Alexander Lamas
Hi Александр Волков, It's a bit hard to answer your question properly as I don't know what sort of application you want to develop. But for web api, please loot at the link below, https://www.django-rest-framework.org/ they have a great documentation to help you when creating a restful web

Re: Create database objects for unit tests

2018-12-13 Thread Alexander Lamas
Hi Jakob, Thanks for your reply. Yes, using the factory and the mocking features is definitely a nice approach. But, in this case I also want to test the end point via making a database call which it will have to have create some stored procedures. That's why I'm trying to create a mechanism

Re: Create database objects for unit tests

2018-12-13 Thread Александр Волков
Hi Alexander. I studied only python, but now I needed to write a program using the jango rest framework. I don’t know anything about him, please tell me which source to use (so that I’ve been told from scratch) so that I can work with him. Thank you very much. -- You received this message