Update instrument type query test and fix multiple similar types bug
This commit is contained in:
parent
7a850b3a94
commit
eedf7202d6
|
|
@ -64,4 +64,4 @@ class InstrumentQuery(object):
|
|||
return BasicKnowledge.objects.all().live()
|
||||
|
||||
def resolve_instrument_types(self, info, **kwargs):
|
||||
return InstrumentType.objects.filter(instruments__isnull=False)
|
||||
return InstrumentType.objects.filter(instruments__isnull=False).distinct()
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@ class InstrumentTypesQueryTestCase(SkillboxTestCase):
|
|||
InstrumentTypeFactory(name='Guitar')
|
||||
self.instrument = InstrumentFactory(new_type=self.type)
|
||||
InstrumentFactory(new_type=second_type)
|
||||
InstrumentFactory(new_type=second_type)
|
||||
InstrumentFactory(new_type=second_type)
|
||||
InstrumentFactory(new_type=second_type)
|
||||
InstrumentFactory(new_type=second_type)
|
||||
|
||||
def test_instrument_types_empty_not_returned(self):
|
||||
result = self.get_client().get_result(INSTRUMENT_TYPES_QUERY)
|
||||
|
|
|
|||
Loading…
Reference in New Issue