Mating and immunity are two major components of fitness and links between them have been demonstrated in a number of recent investigations. In Drosophila melanogaster, a seminal fluid protein, sex-peptide (SP), up-regulates a number of antimicrobial peptide (AMP) genes in females after mating but the resulting effect on pathogen resistance is unclear. In this study, we tested (1) whether SP-induced changes in gene expression affect the ability of females to kill injected non-pathogenic bacteria and (2) how the injection process per se affects the expression of AMP genes relative to SP. The ability of virgin females and females mated to SP lacking or control males to clear bacteria was assayed using an established technique in which Escherichia coli are injected directly into the fly body and the rate of clearance of the injected bacteria is determined. We found no repeatable differences in clearance rates between virgin females and females mated to SP producing or SP lacking males. However, we found that the piercing of the integument, as occurs during injection, up-regulates AMP gene expression much more strongly than SP. Thus, assays that involve piercing, which are commonly used in immunity studies, can mask more subtle and biologically relevant changes in immunity, such as those induced by mating.