def test_delete_eqh(self): emm = factory.EmmFactory(eqt=models.EqtEquipmentTypeCode.objects.get(pk=4)) eqh = factory.EqhFactory(emm=emm) test_url = reverse_lazy(self.signature, args=[eqh.emm.pk, ]) self.assert_success_url(test_url, user=self.user) # for delete views... self.assertEqual(models.EmmMakeModel.objects.filter(pk=eqh.emm.pk).count(), 0)
def test_emm_eqh_hydrophones(self): eqt = models.EqtEquipmentTypeCode.objects.get(pk=4) emm = Factory.EmmFactory(eqt=eqt) # create an Eqh object from the factory, in theory it should share the emm object # when emm.hydrophone is called there should be a single matching entry eqh = Factory.EqhFactory(emm=emm) hydrophone = emm.hydrophone self.assertEquals(eqh, hydrophone)
def setUp(self): super().setUp() self.data = Factory.EqhFactory.get_valid_data() emm = Factory.EmmFactory(pk=4) obj = Factory.EqhFactory(emm=emm) self.test_url = reverse_lazy('whalesdb:update_eqh', args=(obj.pk, 'pop',)) # Since this is intended to be used as a pop-out form, the html file should start with an underscore self.test_expected_template = 'shared_models/shared_entry_form.html' self.expected_view = views.EqhUpdate self.expected_form = forms.EqhForm